$link=mysql_connect("localhost","xxxxx","xxxx");
$db_selected=mysql_select_db('login',$link);
$id=$_POST['id'];
$pw=$_POST['pw'];
$sql="select * from login where 账号='$id' and 密码='$pw'";
$result=mysql_query($sql,$link);
$row=mysql_fetch_row($result);
$result没有值, $sql有值,数据库连接也正常
为什么$result没有值?
$result=mysql_query($sql,$link) or die(mysql_error());
这句爆这样的错,我看不明白
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 '??号='admin' and 密码='123456'' at line 1
你的字段名是‘账号’ ?
追问是的,是不是用中文出现不良反应啊
追答- - 建议不要了,把中文字段名改成英文吧。。
追问恩,我试试先
这个是数据库,不是表名