summaryrefslogtreecommitdiff
path: root/modules/profile/profile.pages.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-08-21 19:36:39 +0000
committerDries Buytaert <dries@buytaert.net>2008-08-21 19:36:39 +0000
commit69e6f411a9ed5dcf3f71d4320218620d3444d295 (patch)
treef4d393bbda7d814c825878785221b65c73b225f8 /modules/profile/profile.pages.inc
parent0e79597812ad0b6b72cf65bfc928c4a591d80ff1 (diff)
downloadbrdo-69e6f411a9ed5dcf3f71d4320218620d3444d295.tar.gz
brdo-69e6f411a9ed5dcf3f71d4320218620d3444d295.tar.bz2
- Patch #225450 by Crell, chx, bjaspan, catch, swentel, recidive et al: next generation database layer for Drupal 7.
Diffstat (limited to 'modules/profile/profile.pages.inc')
-rw-r--r--modules/profile/profile.pages.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/profile/profile.pages.inc b/modules/profile/profile.pages.inc
index ef1392343..56344503c 100644
--- a/modules/profile/profile.pages.inc
+++ b/modules/profile/profile.pages.inc
@@ -110,7 +110,10 @@ function profile_browse() {
function profile_autocomplete($field, $string) {
$matches = array();
if (db_result(db_query("SELECT COUNT(*) FROM {profile_fields} WHERE fid = %d AND autocomplete = 1", $field))) {
- $result = db_query_range("SELECT value FROM {profile_values} WHERE fid = %d AND LOWER(value) LIKE LOWER('%s%%') GROUP BY value ORDER BY value ASC", $field, $string, 0, 10);
+ $result = db_query_range("SELECT value FROM {profile_values} WHERE fid = :fid AND LOWER(value) LIKE LOWER(:value) GROUP BY value ORDER BY value ASC", array(
+ ':fid' => $field,
+ ':value' => $string .'%',
+ ), 0, 10);
while ($data = db_fetch_object($result)) {
$matches[$data->value] = check_plain($data->value);
}