MySQL- Unable to jump to row 0 on MySQL result index

后端 未结 2 1239
失恋的感觉
失恋的感觉 2020-12-07 02:30

I have got an old site that has recently been displaying an error which is weird as its been untouched for some time. I get the following:

Unable to jump to          


        
2条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 02:55

    Try analysing the result before fetching it. If result is empty, skip fetching.

    $result = mysql_query("SELECT * FROM table1");
    if (!$result || !mysql_num_rows($result)) {
        die('Empty set.');
    }
    while ($row = mysql_fetch_array($result)) {
        // Your code here
    }
    

提交回复
热议问题