No edit summary |
m (refresh SMW properties) |
||
Line 17: | Line 17: | ||
); | ); | ||
}} | }} | ||
<noinclude> | <noinclude> | ||
[[Category:Database Functions]]</noinclude> | [[Category:Database Functions]]</noinclude> |
Revision as of 16:42, 11 October 2012
Usage:
$smcFunc['db_quote'] (query, values, connection)
This function should never be used outside the database abstraction layer (Db-*.php or Subs-Db-*.php files) |
Description: Works similar to how db_query works, but it does not execute the query. Formats as if it where going to be and returns the string. It can be used to prepare parts of query to be used later on.
Parameters:
- query the query (or part of it) to be formatted
- values is an array of values you are intending to use in the query.
- connection the database connection to be used.
Return: a string representing the formatted query.
Example:
$realNameMatches[] = $smcFunc['db_quote']( '{string:possible_user}', array( 'possible_user' => $possible_user ) );