diff --git a/mysql-up-del/actions/delete.php b/mysql-up-del/actions/delete.php new file mode 100644 index 0000000..2775ff2 --- /dev/null +++ b/mysql-up-del/actions/delete.php @@ -0,0 +1,18 @@ + echo $sql . "
"; + +//vykonání příkazu a následný "report" +if (mysqli_query($conn,$sql)) { + echo "příkaz byl vykonán"; + header("Location: /?del=$id"); +} else { + echo "Error:" .$sql."
". mysqli_errno($conn); +} + + +?> \ No newline at end of file diff --git a/mysql-up-del/actions/index.php b/mysql-up-del/actions/index.php new file mode 100644 index 0000000..6c4301a --- /dev/null +++ b/mysql-up-del/actions/index.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/mysql-up-del/actions/insert.php b/mysql-up-del/actions/insert.php new file mode 100644 index 0000000..37a3686 --- /dev/null +++ b/mysql-up-del/actions/insert.php @@ -0,0 +1,23 @@ + echo $sql . "
"; +//vykonání příkazu a následný "report" +if (mysqli_query($conn,$sql)) { + $last_id = mysqli_insert_id($conn); + echo "příkaz byl vykonán - ID:" . $last_id; + header("Location: /?id=$last_id"); +} else { + echo "Error:" .$sql."
". mysqli_errno($conn); +} + + +?> \ No newline at end of file diff --git a/mysql-up-del/actions/update.php b/mysql-up-del/actions/update.php new file mode 100644 index 0000000..23d2233 --- /dev/null +++ b/mysql-up-del/actions/update.php @@ -0,0 +1,40 @@ +". mysqli_errno($conn); +} \ No newline at end of file diff --git a/mysql-up-del/index.php b/mysql-up-del/index.php new file mode 100644 index 0000000..6b8034f --- /dev/null +++ b/mysql-up-del/index.php @@ -0,0 +1,54 @@ + + + + + + + + KNIHOVNA + + +

Knihovna

+

UPDATE DATA

+ +
+
+
+
+ +
+ + Byla vytvořena kniha s ID:".$_GET["id"].""; + } + if (isset($_GET["del"])){ + echo "

Byla odstraněna kniha s ID:".$_GET["del"]."

"; + } + if (isset($_GET["up"])){ + echo "

Byla upravena kniha s ID:".$_GET["up"]."

"; + } + ?> + + + + + \ No newline at end of file diff --git a/mysql-up-del/init.php b/mysql-up-del/init.php new file mode 100644 index 0000000..a8a271e --- /dev/null +++ b/mysql-up-del/init.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/mysql-up-del/update.php b/mysql-up-del/update.php new file mode 100644 index 0000000..ccf3839 --- /dev/null +++ b/mysql-up-del/update.php @@ -0,0 +1,43 @@ + + + + + + + + UPDATE + + +

UPDATE DATA

+ +
+
+
+
+
+ +
+ + + + + + \ No newline at end of file diff --git a/php-insert/index.php b/php-insert/index.php index ddef3d8..5e1073c 100644 --- a/php-insert/index.php +++ b/php-insert/index.php @@ -3,7 +3,7 @@ require "init.php"; //příprava k zobrazení dat -$sql = "SELECT * FROM intro ORDER BY id DESC"; +$sql = "SELECT * FROM intro "; $result = mysqli_query($conn,$sql); ?>