MySQL & PHP Parameter 1 as Resource

后端 未结 3 1572
北荒
北荒 2020-12-02 02:22

Alright, PHP is throwing this error at me (in the log) when I run the code mentioned below:

Error

mysql_num_rows() expects pa

3条回答
  •  抹茶落季
    2020-12-02 02:53

    You are missing the mysql_query function, it should be like this:

    $queryFP = "SELECT * FROM table_name_here";
    $queryFP = mysql_query($queryFP) or die(mysql_error());
    $countFP = mysql_num_rows($queryFP);
    $aID = rand(1, $countFP);
    

提交回复
热议问题