Heim >Backend-Entwicklung >PHP-Tutorial >【wamp】php链接MySQL
<code><?php $un=$_POST["userName"]; $pw=$_POST["passWord"]; $con=mysql_connect("localhost","root",""); mysql_select_db("szzoo"); $result=mysql_query("select passWord from login where userName=$un;" ); die(mysql_error()); if (mysql_result($result,0)==$pw) { echo "sucess"; } else { echo "wrong"; } mysql_close($con); ?></code>
Champ 'szzoo' inconnu dans where clause
我的MySQL里有szzoo库,其中也有login表
求大神帮忙啊。。。。
<code><?php $un=$_POST["userName"]; $pw=$_POST["passWord"]; $con=mysql_connect("localhost","root",""); mysql_select_db("szzoo"); $result=mysql_query("select passWord from login where userName=$un;" ); die(mysql_error()); if (mysql_result($result,0)==$pw) { echo "sucess"; } else { echo "wrong"; } mysql_close($con); ?></code>
Champ 'szzoo' inconnu dans where clause
我的MySQL里有szzoo库,其中也有login表
求大神帮忙啊。。。。
$result=mysql_query("select passWord from login where userName='".$un."'");