'I already searched this but didn't find any answer to this question. Actually, i want to add a data in my DB with a PHP / HTML Form. It's a method="post", and the data i have seems to be right.. But the insert simply doesn't work. Is my query bad ? Or it's something with the Data Base ?
The echo doesn't return me null values.
Thanks a lot for answering my question ! :) This is my code :
$sport = $_POST['sport'];
$level = $_POST['level'];
$date = $_POST['date'];
$firsthour = $_POST['first'];
$lasthour = $_POST['last'];
echo "sport: " . $sport . " Level" . $level . " Date ". $date . " first hour" . $firsthour. " last hour " . $lasthour;
$connexion = mysqli_connect("localhost", "root", "", "database");
$reqadd = "insert into commandes ('name', 'id_sport', 'id_niveau', 'date', 'heure_début', 'heure_fin') values ('Amendera Lochan','$sport','$level','$date','$firsthour':00,'$lasthour':00)";
echo $reqadd;
mysqli_query($connexion, $reqadd);