probleme date et heure avec mysql.
Bonsoir tout le monde
Je voudrais savoir à quel heure les internautes ont rempli le formulaire que j'ai créé.
Vu que je suis débutant, j'ai fai des petit manipe.
Voici ci-dessous ce que ma répondu mysql de chez free.fr
Citation:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '11.7.05.,20:58:48) VALUES ('mr','debailleul','vincent','vincent
Voici mon code ci_dessous
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
|
<?php
if (empty($_POST['civilite'])) die ("ERREUR : Quel est votre titre");
if (empty($_POST['nom']) || empty($_POST['prenom']) || empty($_POST['email']) || empty($_POST['objet']) || empty($_POST['message']))
{
echo "aucun champs ne doit être vide. <a href=\"envoimessage.html\">Retour</a>";
}
else
{
$liendb = mysql_connect("sql.free.fr","login","pass");
mysql_select_db('v_debailleul') or die(mysql_error());
$datemessage=date("j.n.y.");
$heure=date("H:i:s");
mysql_query("INSERT INTO tbl_message_recu (civilite,nom,prenom,objet,email,message,$datemessage,$heure) VALUES ('".$_POST['civilite']."','".$_POST['nom']."','".$_POST['prenom']."','".$_POST['email']."','".$_POST['objet']."','".$_POST['message']."','".$POST['date']."','".$_POST['heure']."')") or die (mysql_error());
mysql_query("INSERT INTO tbl_messagerie (civilite,nom,objet,$datemessage,$heure) VALUES ('".$_POST['civilite']."','".$_POST['nom']."','".$_POST['objet']."','".$POST['date']."','".$_POST['heure']."')") or die (mysql_error());
mysql_close();
}
?> |
Pourriez m'aider a finir mon code svp.
Je vous en remercie d'avance.
Cordialement
A bientôt