mysql_affected_rows(MYSQL *) returns the number of affected
rows in the last query when doing an INSERT, UPDATE or
DELETE. Except, if DELETE is used without a WHERE clause
then the table is truncated which is much faster! In this case it
returns the number of records affected as zero.
mysql_insert_id(MYSQL *) returns the given ID of the last
query when inserting a row into a table with an AUTO_INCREMENT index.
See section How can I get the unique ID for the last inserted row?
Some queries, LOAD DATA INFILE... and INSERT INTO
... SELECT ..., UPDATE return additional info. The result is
returned in mysql_info(MYSQL *). mysql_info() returns a null
pointer if there is no additional information.
Go to the first, previous, next, last section, table of contents.