note 129600 added to class.pdo

From: Date: Thu, 20 Jun 2024 06:55:44 +0000
Subject: note 129600 added to class.pdo
Groups: php.notes 
Request: Send a blank email to php-notes+get-221387@lists.php.net to get a copy of this message
<?php include 'db.php'; // Check of het formulier is verzonden if ($_SERVER["REQUEST_METHOD"] == "POST") { // Haal de waarden op uit het formulier $product_naam = $_POST['product_naam']; $prijs_per_stuk = $_POST['prijs_per_stuk']; $omschrijving = $_POST['omschrijving']; $con = mysqli_connect($product_naam,$prijs_per_stuk,$omschrijving) // SQL query om product toe te voegen $mysql = "INSERT INTO producten (product_naam, prijs_per_stuk, omschrijving) VALUES ('$product_naam', '$prijs_per_stuk', '$omschrijving')"; if ($conn->query($mysql) === TRUE) { echo "Product succesvol toegevoegd.<br>"; } else { echo "Error: " . $mysql . "<br>" . $conn->error; } } ?> <!DOCTYPE html> <html> <head> <title>Voeg product toe</title> </head> <body> <h2>Voeg een nieuw product toe</h2> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"> Product naam: <input type="text" name="product_naam"><br><br> Prijs per stuk: <input type="text" name="prijs_per_stuk"><br><br> Omschrijving: <input type="text" name="omschrijving"><br><br> <input type="submit" value="Voeg product toe"> </form> </body> </html> <?php // Sluit de connectie $conn->close(); ?> ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 145.100.74.49) ---- Manual Page -- https://php.net/manual/en/class.pdo.php Edit -- https://main.php.net/note/edit/129600 Del: integrated -- https://main.php.net/note/delete/129600/integrated Del: useless -- https://main.php.net/note/delete/129600/useless Del: bad code -- https://main.php.net/note/delete/129600/bad+code Del: spam -- https://main.php.net/note/delete/129600/spam Del: non-english -- https://main.php.net/note/delete/129600/non-english Del: in docs -- https://main.php.net/note/delete/129600/in+docs Del: other reasons-- https://main.php.net/note/delete/129600 Reject -- https://main.php.net/note/reject/129600 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221387) next »