update in mysql_query sometime return null

后端 未结 2 566
挽巷
挽巷 2021-01-26 16:19

I use this code for update a record in mysql
This is my code:



        
2条回答
  •  天命终不由人
    2021-01-26 16:57

    $result in this case is just a resource, it does not contain the reason.

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

    Source: PHP Manual

    So you can only get TRUE / FALSE from it in your update query. It won't tell you the reason. But as you said it happens when your server is overcrowded so reason probably is "too many connections"

提交回复
热议问题