(Created page with "{{smcfunc |function=db_quote |usage=$smcFunc['db_quote'] (query, values, connection) |description=Works similar to how db_query works, but it does not execute the query. Form...") |
(briefer description) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{smcfunc | {{smcfunc | ||
|function=db_quote | |function=db_quote | ||
|internal=true | |||
|usage=$smcFunc['db_quote'] (query, values, connection) | |usage=$smcFunc['db_quote'] (query, values, connection) | ||
|description= | |description=Formats the query as [[db_query]] does, but it does not execute the query. Used to prepare parts of query to be used later on. | ||
|parameters={{parmdesc | |parameters={{parmdesc | ||
|query|d1=the query (or part of it) to be formatted | |query|d1=the query (or part of it) to be formatted | ||
Line 16: | Line 17: | ||
); | ); | ||
}} | }} | ||
<noinclude> | <noinclude> | ||
[[Category:Database Functions | [[Category:Database Functions]]</noinclude> | ||
Latest revision as of 16:52, 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: Formats the query as db_query does, but it does not execute the query. 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 ) );