delete.php

Gesponsorde koppelingen

PHP script bestanden

  1. wijzigen.php
  2. header_klant.php
  3. overzicht.php
  4. logout.php
  5. login.php
  6. klant.php
  7. invoeg.php
  8. index.php
  9. delete.php
  10. admin.php
  11. header_admin.php
  12. header.php
  13. gegevens.php
  14. footer.php
  15. connection.php
  16. java.html
  17. style.css

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php require_once ("system/header_admin.php") ?>

<div id="navigation">
<ul>
<li> <a href="index.php"> Home </a></li>
<li> <a href="overzicht.php?nr=0-10&sorteer_asc=1"> Overzicht </a></li>
<li> <a href="logout.php"> Logout </a></li>
</ul>
</div>
<div id="content">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php


if (isset($_GET['deleteid'])){
    $id = $_GET['deleteid'];
    $query = "DELETE FROM tabel WHERE id = {$id} LIMIT 1";
    $result = mysql_query($query, $connection);
    if(!$result){
        echo "<a href=\"overzicht.php?nr=0-10&sorteer_asc=1\"> TERUG </a><br />";
        die("Database query failed: " . mysql_error());
    }

        echo "Deleten van af records succesvol<br />";
        echo "<a href=\"overzicht.php?nr=0-10&sorteer_asc=1\"> TERUG </a>";
        
}
elseif (!empty($_POST['1']) && (!empty($_POST['2']))){
        
        $var1 = $_POST['1'];
        $var2 = $_POST['2'];
        if ($var2 >= $var1){
        
            while ($var1 < $var2){
                $query = "DELETE FROM tabel WHERE id={$var1}";
                $result = mysql_query($query, $connection);
                if(!$result){
                    echo "<a href=\"overzicht.php?nr=0-10&sorteer_asc=1\"> TERUG </a><br />";
                    die("Database query failed: " . mysql_error());
                }

                $var1++;
            }

            $query = "DELETE FROM tabel WHERE id={$var2}";
            $result = mysql_query($query, $connection);
            if(!$result){
                echo "<a href=\"overzicht.php?nr=0-10&sorteer_asc=1\"> TERUG </a><br />";
                die("Database query failed: " . mysql_error());
            }

            echo "delete succesvol<br />";
            echo "<a href=\"overzicht.php?nr=0-10&sorteer_asc=1\"> TERUG </a><br />";
                            
        }
else {
        echo "error veld 2 is groter dan veld 1";
        }

}
elseif (isset($_GET['del']) && $_GET['del'] == "truncate") {
    $query = "DELETE FROM tabel";
    $query2 = "ALTER TABLE tabel AUTO_INCREMENT =1";
        
    $result = mysql_query($query, $connection);
    if(!$result){
        echo "<a href=\"overzicht.php?nr=0-10&sorteer_asc=1\"> TERUG </a><br />";
        die("Database query failed: " . mysql_error());
    }

        
    $result2 = mysql_query($query2, $connection);
    if(!$result2){
        echo "<a href=\"overzicht.php?nr=0-10&sorteer_asc=1\"> TERUG </a><br />";
        die("Database query failed: " . mysql_error());
    }

    
        echo "Deleten van af records:  succesvol<br />";
        echo "<a href=\"overzicht.php?nr=0-10&sorteer_asc=1\"> TERUG </a>";
}
else {
    header("Location: overzicht.php?nr=0-10&sorteer_asc=1");
}



?>

</div>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php require_once ("system/footer.php") ?>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.