Impossibilité de trouver mes données dans ma base avec phpmyadmin
bonjour
j'ai codé la requête sql suivante, je ne reçois pas de message d'erreur
je ne récupère pas les données dans la base
voilà le code 2 fichiers
merci
1) connection.php
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <?php
DEFINE('serveur','localhost');
DEFINE('user','root');
DEFINE('mdp','mdp1');
DEFINE('db','reflink');
$dbcon= mysqli_connect(serveur,user,mdp,db);
if (!$dbcon){
die ('error');
}
echo 'connected';
?> |
2)ins.php
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| <?php
if (isset($_POST['submitted'])){
include_once('connection.php');
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$sqlinvest="INSERT INTO refmail (First_Name, Last_Name) VALUES ('$fname','$lname)";
if (!mysqli_query($dbcon,$sqlinsert)){
die ('error inserting');
}
}
?>
<html>
<head>
<title> insert data </title/>
</head>
<body>
<h1> insert data </h1>
<form method = "post" action "ins.php">
<input type = "hidden" name "submitted" value "true"/>
<field set>
<legend> new people </legend>
<label> First_Name : <input type "text" name="fname"/> </label>
<label> Last_Name : <input type "text" name="lname"/> </label>
</field set>
<br/>
<input type = "submit" value = "enregistrer" />
</form>
</body>
</html> |