Commit f28b98cb authored by catch's avatar catch
Browse files

Issue #1182428 by Dave Reid: Fixed Document that db_like() does not work when used with db_query().

parent 9727bd09
......@@ -2553,13 +2553,18 @@ function db_escape_field($field) {
* a backslash. Use this to do a search for a verbatim string without any
* wildcard behavior.
*
* You must use a query builder like db_select() in order to use db_like() on
* all supported database systems. Using db_like() with db_query() or
* db_query_range() is not supported.
*
* For example, the following does a case-insensitive query for all rows whose
* name starts with $prefix:
* @code
* $result = db_query(
* 'SELECT * FROM person WHERE name LIKE :pattern',
* array(':pattern' => db_like($prefix) . '%')
* );
* $result = db_select('person', 'p')
* ->fields('p')
* ->condition('name', db_like($prefix) . '%', 'LIKE')
* ->execute()
* ->fetchAll();
* @endcode
*
* Backslash is defined as escape character for LIKE patterns in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment