mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\qcc\truckdelivery.php on line 9 no database selected

后端 未结 2 1084
我在风中等你
我在风中等你 2020-12-07 05:32



        
相关标签:
2条回答
  • 2020-12-07 06:03

    Your connect.php file is probably missing a mysql_select_db() statement. Check that.

    0 讨论(0)
  • 2020-12-07 06:05

    Check for MySQL errors before processing the result of a query. Most likely your query went wrong some way, so mysql_query() did not return a valid result and thus mysql_fetch_assoc() fails.

    // ...
    $PK = mysql_query($sql_PK, $connect);
    if ( mysql_error() ) {
      die ( mysql_error();
    }
    $row_PK = mysql_fetch_assoc($PK);
    // ...
    

    Besides: mysql_x() functions are deprecated. Use PDO or MySQLi instead.

    0 讨论(0)
提交回复
热议问题