db_quote From Online Manual

Revision as of 10:19, 2 June 2011 by Emanuele (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Usage:

$smcFunc['db_quote'] (query, values, connection)


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
	)
);



Advertisement: