下面就是我得到錯誤代碼:PHP:錯誤:語法是用戶接近「=」 a_name「‘=’another_name」在行1
$f1=$row['ParentName'];
$f2=$row['Full_Name'];
$f3=$row["Address_1"];
$f4= $row['Address_2'];
$f5=$row['City'];
$f6=$row['State'];
$f7=$row['Country'];
$f9=$row['Contact_No'];
$sql1="UPDATE login_signup ".
"SET $f1=' ".$_POST["pname"]." ',$f2= ' ".$_POST["fname"]." ', $f3= ' ".$_POST["addr1"]." ',$f4= ' ".$_POST["addr2"]." ',$f5= ' ".$_POST["city"]." ', $f6= ' ".$_POST["state"]." ',$f7= ' ".$_POST["country"]." ', $f9= ' ".$_POST["cn"]." ' ".
"WHERE $var= ' ".$_POST["email"]." '";
錯誤是這樣的:
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 '=' ABCD ',= ' XYZ ', = ' dfgh ',= ' ZXCV ',= '' at line 1
ABCD,XYZ,ZXCV,dfgh - 通過形式全名,parentname提交....分別
你做了什麼錯誤? – ajaykumartak
只是回聲'$ sql1'&看到 – Supravat
您使用的是像'$ f1'變量行SQL,'$ f2'在您的查詢,而不是列名,你確定這些變量不爲空? – ajaykumartak