SELECT * FROM `admin` WHERE user_name = tte12
今天查询时输入如上语句,结果出现如下错误,将SQL语句在数据库里执行查询无结果,出现问题,最后发现tte12少用了个引号(莫笑初学者。)
Warning: mysql_num_rows() expects parameter 1 to be resource, string given in 1.php on line 30 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in mysql.php on line 115
最后改写成如下,便正常了。
SELECT * FROM `admin` WHERE user_name = ‘tte12’