Why does mysql_query() return TRUE with a SELECT statement?

后端 未结 7 1778
日久生厌
日久生厌 2020-12-20 15:24

According to the manual of mysql_query() and to everything I know about this function that I used so many times, it can either return a resource or FALSE if the

7条回答
  •  天涯浪人
    2020-12-20 15:54

    For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.

    For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error.

    (from http://php.net/manual/en/function.mysql-query.php)

    You say that SELECTs are returning boolean true? Not just a resource that isn't zero :) ?

提交回复
热议问题