mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource

后端 未结 30 2675
鱼传尺愫
鱼传尺愫 2020-11-21 06:25

I am trying to select data from a MySQL table, but I get one of the following error messages:

mysql_fetch_array() expects parameter 1 to be resource,

30条回答
  •  梦如初夏
    2020-11-21 07:13

    $query = "SELECT Name,Mobile,Website,Rating FROM grand_table order by 4";
    
    while( $data = mysql_fetch_array($query))
    {
        echo("$data[0]$data[1]$data[2]$data[3]");      
    }
    

    Instead of using a WHERE query, you can use this ORDER BY query. It's far better than this for use of a query.

    I have done this query and am getting no errors like parameter or boolean.

提交回复
热议问题