Welcome to PHP Smarty Q&A, where you can ask programmaing questions and receive answers from other members of the community for PHP, Smarty, MYSQL related. You can also share or save your scripts in this repository for future reference.
Bulk SMS Marketing

ADODB equivalent to mysql_affected_rows or mysql_insert_id

+2 votes
183 views
I am using ADODB abstract library for my project as I know in future mysql will be depracated hence I need to be prepared for substitute with better abstract class.

I would like to know equivalent to mysql_affected_rows or mysql_insert_id in ADODB.

Any help will be highly appreciated.
asked Nov 12, 2014 in PHP by anilk (440 points)

1 Answer

+1 vote
 
Best answer

Its given in the tutorial, your search on google must have been a great help.

http://phplens.com/lens/adodb/tute.htm

ADODB also supports $connection->Affected_Rows() (returns the number of rows affected by last update or delete) and $recordset->Insert_ID() (returns last autoincrement number generated by an insert statement). Be forewarned that not all databases support the two functions.

so here it is

Equivalent to mysql_affected_rows is

$connection->Affected_Rows();

And Equivalent to mysql_insert_id is

$recordset->Insert_ID();

 

answered Nov 12, 2014 by robert (13,210 points)
selected Nov 12, 2014 by anilk
I searched but may be not using the right keyword on google, he he.. Thanks for the help and works like a charm.
...