Db fetch row: Difference between revisions From Online Manual

Jump to: navigation, search
mNo edit summary
No edit summary
Line 1: Line 1:
{{smcfunc
{{smcfunc
|function=db_fetch_row
|function=db_fetch_row
|order_position=3
|usage=$smcFunc['db_fetch_row'] (result)
|usage=$smcFunc['db_fetch_row'] (result)
|description=return the exact same results as [http://php.net/mysql_fetch_row mysql_fetch_row]. Frequently used when is known the query returns only one row of data.
|description=return the exact same results as [http://php.net/mysql_fetch_row mysql_fetch_row]. Frequently used when is known the query returns only one row of data.

Revision as of 20:17, 26 July 2011

Usage:

$smcFunc['db_fetch_row'] (result)


Description: return the exact same results as mysql_fetch_row. Frequently used when is known the query returns only one row of data.

Parameters:

  • result a query resource as returned for example by db_query

Return: an array of the values obtained from the query

Notes: emulated while using SQlite with smf_sqlite_fetch_row.

Example:

while ($row = $smcFunc['db_fetch_row']($request))
	$toDelete[] = $row[0];

Example using the function list:


list ($first_message, $last_message) = $smcFunc['db_fetch_row']($request);



Advertisement: