日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

rawquery 没扎到返回什么_当mysql_query返回false时

發布時間:2025/3/21 数据库 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 rawquery 没扎到返回什么_当mysql_query返回false时 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Aside from writing the wrong query and not having permissions to access a table, when mysql_query returns false? Are there any other cases?

解決方案

See the reference guide:

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.

The returned result resource should be passed to mysql_fetch_array(),

and other functions for dealing with result tables, to access the

returned data.

Use mysql_num_rows() to find out how many rows were returned for a

SELECT statement or mysql_affected_rows() to find out how many rows

were affected by a DELETE, INSERT, REPLACE, or UPDATE statement.

mysql_query() will also fail and return FALSE if the user does not

have permission to access the table(s) referenced by the query.

Edit: Clarification of what those errors actually are.

So we have list of things that can return false:

When a MySQL statement which returns a resultset gets an error

When a MySQL statement which doesn't return anything gets an error

When a user does not have MySQL permission to access a table reference

In my opinion the first 2 are the ones that are a bit diffuse. What are the possible errors? There are 59 different client errors you can get from MySQL. These are more system related errors which we can presume that php will handle and probably wrap into a smaller amount of abstract errors.

Except for those client errors you have a set of more abstract errors which you can encounter during usage which is more related to using the actual API inside the application rather than the raw access to the MySQL server. Those are:

Access denied

Can't connect to [local] MySQL server

Lost connection to MySQL server

Client does not support authentication protocol

Password Fails When Entered Interactively

Host 'host_name' is blocked

Too many connections

Out of memory

MySQL server has gone away

Packet too large

Communication Errors and Aborted Connections

The table is full

Can't create/write to file

Commands out of sync

Ignoring user

Table 'tbl_name' doesn't exist

Can't initialize character set

Table corruption issues

Syntax related issues

Here are the references of what I just said:

總結

以上是生活随笔為你收集整理的rawquery 没扎到返回什么_当mysql_query返回false时的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。