View Full Version : custom profile query
vbted
02-24-2005, 11:37 PM
I need a query that matches info from an input box with a custom user profile and outputs that users id # and help or ideas? tanx.
sabret00the
02-25-2005, 10:15 AM
so basically like a search, you put in "knitting" and it'll come back with all the user id's that have knitting in that profile field?
can i see the attempted code thus far please?
vbted
02-25-2005, 05:15 PM
$get_userid = $DB_site->query_first("SELECT " . TABLE_PREFIX . "userid FROM " . TABLE_PREFIX . "profilefield WHERE " . TABLE_PREFIX . "field19='$normalanswer1'");
$normalanswer1 comes from the input box.
as you can tell this is the first time i've even looked at SQL. -Ted
Dean C
02-25-2005, 06:02 PM
Hey Ted, There's nothing wrong with your SQL there, it's your usage of the query_first function, which isn't appropriate in this instance. May I suggest taking a look at the list of resources stickied at the top of this forum if you wish to learn a little more about SQL.
vbted
02-25-2005, 06:10 PM
That's prob a good idea. thanks
i'm lost, sorry. maybe if i explain it better....
for example; I have a form that is gonna be filled out by the general public, the first input box is called "$normalanswer1". If this info matches one of my users custom field19 I would like the query to return that users id #.
I hope this helps i'm in need of some serious help.
$get_userid = $DB_site->query("SELECT userid
FROM " . TABLE_PREFIX . "user
WHERE " . TABLE_PREFIX . "field19='$normalanswer1'");
$user_id = $DB_site->query($get_userid);
am i close?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.