在select子句中,MYSQL錯誤1064。

[英]MYSQL error 1064 in select clause


As I am beginner so I am facing syntax error in this query.

因為我是初學者,所以在這個查詢中我面臨語法錯誤。

$SQL = "SELECT * FROM registration WHERE email = ".$email." AND password = ".$password."";

6 个解决方案

#1


0  

Please try this one, you should use single quote.

請試試這個,你應該用單引號。

$SQL = "SELECT * FROM registration WHERE email = '".$email."' AND password = '".$password."'";

$SQL = "SELECT * FROM registration WHERE email = '".$email。'和密碼= '".$password."'";

#2


4  

You have syntax error with the query. Try to change it to

查詢有語法錯誤。試着改變它。

$SQL = "SELECT * FROM registration WHERE email='".$email."' AND password='".$password."'";

#3


1  

Put single quote to value field like this

像這樣把單引號放到value字段中

$SQL = "SELECT * FROM registration
           WHERE email = '".$email."' AND password ='".$password."'";

#4


1  

you should put single quote before and after the variable.

你應該在變量前后加上單引號。

$SQL = "SELECT * FROM registration WHERE email = '".$email."' AND password = '".$password."'";

#5


0  

$SQL = "SELECT * FROM registration WHERE email='$email' AND password='$password'";

Try this..

試試這個. .

#6


0  

You are passing a string and string should be wrapped in single quotes. Try this -

您正在傳遞一個字符串,字符串應該用單引號括起來。試試這個,

$SQL = "SELECT * FROM registration WHERE email = '".$email."' AND password = '".$password."'";
关注微信公众号

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2014/04/09/7df139b38e1fcef31aa49042dbf373e2.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com