在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."'";
智能推荐

注意!

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



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

赞助商广告