Rechercher dans le manuel MySQL
28.7.29.2 What Results You Can Get from a Query
In addition to the result set returned by a query, you can also get the following information:
mysql_affected_rows()
returns the number of rows affected by the last query when doing anINSERT
,UPDATE
, orDELETE
.For a fast re-create, use
TRUNCATE TABLE
.mysql_num_rows()
returns the number of rows in a result set. Withmysql_store_result()
,mysql_num_rows()
may be called as soon asmysql_store_result()
returns. Withmysql_use_result()
,mysql_num_rows()
may be called only after you have fetched all the rows withmysql_fetch_row()
.mysql_insert_id()
returns the ID generated by the last query that inserted a row into a table with anAUTO_INCREMENT
index. See Section 28.7.7.38, “mysql_insert_id()”.Some queries (
LOAD DATA
,INSERT INTO ... SELECT
,UPDATE
) return additional information. The result is returned bymysql_info()
. See the description formysql_info()
for the format of the string that it returns.mysql_info()
returns aNULL
pointer if there is no additional information.
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-query-results.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.