Proper way to fix this and have it work | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Proper way to fix this and have it work

// KlantID uit het formulier halen $ID = $_POST ['autoidvak']; // Klantgegevens uit de tabel halen $pdo = new PDO('mysql:host=localhost;dbname=garage2;charset=UTF8','root','root'); $autos = $pdo->prepare("SELECT * FROM klant WHERE ID = :ID"); $autos->execute(["ID => $ID"]); // Klantgegevens in een nieuw formulier laten zien echo "<form action='gar-update-klant3.php' method='POST'>'"; foreach ($klanten as $klant) { // KlantID mag niet gewijzigd worden echo " klantID:" . $klant["ID"]; echo "<input type='hidden' name='klantidvak' value='' . $klant["ID"] . '>"; echo "<br>"; echo " Klantnaam: <input type='text'> "; echo " name= 'klantnaamvak'> "; echo " value= '" . $klant["naam"]. "'"; echo "<br>"; echo " Klantadres: <input type='text'> "; echo " name= 'klantadresvak'> "; echo " value= '" . $klant["adres"]. "'"; echo "<br>"; echo " Klantwoonplaats: <input type='text'> "; echo " name= 'klantwoonplaatsvak'> "; echo " value= '" . $klant["woonplaats"]. "'"; echo "<br>"; echo " Klantpostcode: <input type='text'> "; echo " name= 'klantpostcodevak'> "; echo " value= '" . $klant["postcode"]. "'"; echo "<br>"; }

23rd Jun 2022, 9:58 PM
7 RTG
1 Answer
0
Comment the code in english for us to understand
27th Jun 2022, 3:23 AM
Shubh
Shubh - avatar