Db insert id: Difference between revisions From Online Manual

Jump to: navigation, search
No edit summary
m (refresh SMW properties)
 
Line 11: Line 11:
|example=<nowiki>$bcinfo['id_poll'] = $smcFunc['db_insert_id']('{db_prefix}polls', 'id_poll');</nowiki>
|example=<nowiki>$bcinfo['id_poll'] = $smcFunc['db_insert_id']('{db_prefix}polls', 'id_poll');</nowiki>
}}
}}
<noinclude>
<noinclude>
[[Category:Database Functions]]</noinclude>
[[Category:Database Functions]]</noinclude>

Latest revision as of 16:41, 11 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: