Bonjour,
J'ai un problème dans la requête pour insertion alors SVP veuillez me dire le problème ou il est :
Pour la page .php :
<?php
$db = new PDO("mysql:host = localhost; dbname=mysql", "root", "");
$req = "insert into client values('".$_GET["Code"]."','".$_GET["Nom"]."','".$_GET["Prenom"]."','".$_GET["Adresse"]."','".$_GET["Tel"]."')";
$db->query($req);
echo "<html><body><h1>Client ajouté avec succès</h1></body></html>";
?>
pour la page .html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="AjouterClient.php" method="get" style=" table-layout:auto; border:solid; border-color: blue;" >
<table>
<tr>
<td>Code :</td><td><input type="text" name="Code"></td>
</tr>
<tr>
<td>Nom :</td><td><input type="text" name="Nom"> </td>
</tr>
<tr>
<td>Prenom :</td><td><input type="text" name="Prenom"> </td>
</tr>
<tr>
<td>Adresse:</td><td><input type="text" name="Adresse"> </td>
</tr>
<tr>
<td> Tel:</td><td><input type="text" name="Tel"> </td>
</tr>
<tr>
<td><input type="submit" name="Valider"> </td>
</tr>
</table>
</form>
</body>
</html>
Pour l'afficage il m'affiche le client ajouter avec succées c'est tout !