Db insert id: Difference between revisions From Online Manual

Jump to: navigation, search
(Created page with "{{smcfunc |function=db_insert_id |usage=$smcFunc['db_insert_id'] (table, field, connect) |description=Will return exact same results as [http://php.net/mysql_insert_id mysql_inse...")
 
No edit summary
Line 13: Line 13:


<noinclude>
<noinclude>
[[Category:Database Functions]]
[[Category:Database Functions]]</noinclude>
[[Category:2.0]]
[[Category:Customizing SMF]]
[[Category:Developing SMF]]</noinclude>

Revision as of 21:50, 8 October 2012

Usage:

$smcFunc['db_insert_id'] (table, field, connect)


Description: Will return exact same results as mysql_insert_id.

Parameters:

  • table holds the table name that was affected.
  • field holds the name of the field that was affected.
  • connection the database connection.

Return: the ID generated in the last query.

Example:

$bcinfo['id_poll'] = $smcFunc['db_insert_id']('{db_prefix}polls', 'id_poll');



Advertisement: