why does mysql_fetch_array() expect parameter 1 to be resource? why isn't parameter 1 resource?

后端 未结 4 1181
南笙
南笙 2021-01-26 18:09

Warning: mysql_fetch_array() expects parameter 1 to be resource, string given in C:\\xampp\\htdocs\\test\\index.php on line 19

 

        
4条回答
  •  死守一世寂寞
    2021-01-26 18:38

    Your parameter to mysql_fetch_array() function is your SQL statement string. This is what your warning say. You should first use $res = mysql_query($sql); and pass $res as parameter to mysql_fetch_array()

提交回复
热议问题