我有一个向我显示此错误的网络服务
您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以便在'0'附近使用正确的语法,date_de_naissance ='1988-02-02',lieu_de_naissance ='在第4行{“items”:[[“succes”]]}
<?php
include('settings.php');
mysql_connect($host,$user,$password);
mysql_select_db($base);
mysql_query('SET CHARACTER SET utf8');
$id_patient = $_GET['id_patient'];
$nom = $_GET['nom'];
$prenom = $_GET['prenom'];
$Sexe = $_GET['Sexe'];
$date_de_naissance = $_GET['date_de_naissance'];
$lieu_de_naissance = $_GET['lieu_de_naissance'];
$adresse = $_GET['adresse'];
$latitude = $_GET['latitude'];
$longitude = $_GET['longitude'];
$telephone = $_GET['telephone'];
$email = $_GET['email'];
$situation_familiale = $_GET['situation_familiale'];
$profession = $_GET['profession'];
$numero_securite_sociale = $_GET['numero_securite_sociale'];
$taille = $_GET['taille'];
$poids = $_GET['poids'];
$groupe_sanguin = $_GET['groupe_sanguin'];
$allergies = $_GET['allergies'];
$antecedents_chirurgicaux = $_GET['antecedents_chirurgicaux'];
$antecedents_medicaux = $_GET['antecedents_medicaux'];
$antecedents_familiaux = $_GET['antecedents_familiaux'];
if ($id_patient!= NULL )
{
$req = "UPDATE patient SET nom = '".$nom."' , prenom = '".$prenom.", Sexe = '".$Sexe."',
date_de_naissance = '".$date_de_naissance."',
lieu_de_naissance = '".$lieu_de_naissance."',
adresse = '".$adresse."',
latitude = '".$latitude."',
longitude = '".$longitude."',
telephone = '".$telephone."',
email = '".$email."',
situation_familiale = '".$situation_familiale."',
profession = '".$profession."',
numero_securite_sociale = '".$numero_securite_sociale."',
taille = '".$taille."',
poids = '".$poids."',
groupe_sanguin = '".$groupe_sanguin."',
allergies = '".$allergies."',
antecedents_chirurgicaux = '".$antecedents_chirurgicaux."',
antecedents_medicaux = '".$antecedents_medicaux."',
antecedents_familiaux = '".$antecedents_familiaux."'
WHERE id_patient = '".$id_patient."' ";
$sql=mysql_query($req);
echo mysql_error();
$items = array("items" => NULL);
$items["items"][] = array("succes");
echo json_encode($items,JSON_UNESCAPED_UNICODE);
}
else{$items = array("items" => NULL);
$items["items"][] = array("erreur");
echo json_encode($items,JSON_UNESCAPED_UNICODE);}
?>
答案 0 :(得分:0)
缺少结束语。
$req = "UPDATE patient SET nom = '".$nom."' , prenom = '".$prenom."', Sexe = '".$Sexe."',