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_INCREMENTindex. See Section 5.4.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 aNULLpointer if there is no additional information.