Erreur de syntaxe Erreur de syntaxe ajout !
Posté : 30 oct. 2005, 18:29
Bonjour,
Alors voila j'ai fait un formulaire d'inscription avec dreamweaver MX !
Quand je remplis les champs et quand je clique sur le bouton, il me met cette erreur apres :
Erreur de syntaxe près de '16:27:18, 'lhkljh', NULL, 'jklhjklh', 'jkhlkh')' à la ligne 1 !
Soit voici le code :
Merci !
Alors voila j'ai fait un formulaire d'inscription avec dreamweaver MX !
Quand je remplis les champs et quand je clique sur le bouton, il me met cette erreur apres :
Erreur de syntaxe près de '16:27:18, 'lhkljh', NULL, 'jklhjklh', 'jkhlkh')' à la ligne 1 !
Soit voici le code :
<?php require_once('Connections/astuce.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$time = date("Y/m/d H:i:s");
$insertSQL = sprintf("INSERT INTO membre (id, login, pass, temps, mail, astuces, nom, age) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['id'], "int"),
GetSQLValueString($_POST['login'], "text"),
GetSQLValueString($_POST['pass'], "text"),
GetSQLValueString($time, "temps"),
GetSQLValueString($_POST['mail'], "text"),
GetSQLValueString($_POST['astuces'], "text"),
GetSQLValueString($_POST['nom'], "text"),
GetSQLValueString($_POST['age'], "text"));
mysql_select_db($database_astuce, $astuce);
$Result1 = mysql_query($insertSQL, $astuce) or die(mysql_error());
$insertGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_astuce, $astuce);
$query_inscription = "SELECT * FROM membre";
$inscription = mysql_query($query_inscription, $astuce) or die(mysql_error());
$row_inscription = mysql_fetch_assoc($inscription);
$totalRows_inscription = mysql_num_rows($inscription);
?>
Qu'est ce qu'il ne va pas ?Merci !