From e38cbf11f8e5e9ec08371156e1675eb65efc1c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=A0krab=C3=A1nek?= Date: Fri, 6 Jan 2023 11:27:27 +0100 Subject: [PATCH 1/4] mod gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3a80ef7..06eaf4e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /fuel/app/cache/*/* /fuel/app/config/crypt.php +init.php \ No newline at end of file From b0391cfbd60f5a0d6348ee74323c9530ef4c3a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=A0krab=C3=A1nek?= Date: Fri, 6 Jan 2023 11:28:20 +0100 Subject: [PATCH 2/4] delete init --- php-insert/init.php | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 php-insert/init.php diff --git a/php-insert/init.php b/php-insert/init.php deleted file mode 100644 index a8a271e..0000000 --- a/php-insert/init.php +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file From aa20d093195e4a6f265429b2bd1d896f31817842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=A0krab=C3=A1nek?= Date: Fri, 6 Jan 2023 11:31:05 +0100 Subject: [PATCH 3/4] add init bakup --- php-insert/init.bak.php | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 php-insert/init.bak.php diff --git a/php-insert/init.bak.php b/php-insert/init.bak.php new file mode 100644 index 0000000..05db4e9 --- /dev/null +++ b/php-insert/init.bak.php @@ -0,0 +1,9 @@ + \ No newline at end of file From 7bafaa5a95eeb35f29abfbd88ecc35ed558f19ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=A0krab=C3=A1nek?= Date: Fri, 6 Jan 2023 12:28:02 +0100 Subject: [PATCH 4/4] db insert part2 --- .gitignore | 1 + php-insert-part2/delete.php | 18 +++++++++++++ php-insert-part2/index.php | 53 +++++++++++++++++++++++++++++++++++++ php-insert-part2/insert.php | 23 ++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 php-insert-part2/delete.php create mode 100644 php-insert-part2/index.php create mode 100644 php-insert-part2/insert.php diff --git a/.gitignore b/.gitignore index 06eaf4e..4a1605b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ /fuel/app/cache/*/* /fuel/app/config/crypt.php +#nezapomenout na ignorování souboru s "citlivými údaji" init.php \ No newline at end of file diff --git a/php-insert-part2/delete.php b/php-insert-part2/delete.php new file mode 100644 index 0000000..4ecb358 --- /dev/null +++ b/php-insert-part2/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/php-insert-part2/index.php b/php-insert-part2/index.php new file mode 100644 index 0000000..3a36d33 --- /dev/null +++ b/php-insert-part2/index.php @@ -0,0 +1,53 @@ + + + + + + + + + + + + +
+
+
+
+ +
+ + Byla vytvořena kniha s ID:".$_GET["id"].""; + } + if (isset($_GET["del"])){ + echo "

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

"; + } + ?> + + +
    + 0) { + while ($row = mysqli_fetch_assoc($result)){ + echo "
  • " . $row["id"]. ") ". $row["nazev"]." <-- ". $row["autor"]." | rok: ".$row["rok_vydani"]; + echo ' Vymazat'; + echo "
  • "; + } + } + ?> +
+ + + + + \ No newline at end of file diff --git a/php-insert-part2/insert.php b/php-insert-part2/insert.php new file mode 100644 index 0000000..6b6a5d6 --- /dev/null +++ b/php-insert-part2/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