vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   custom profile query (https://vborg.vbsupport.ru/showthread.php?t=76993)

vbted 02-24-2005 11:37 PM

custom profile query
 
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?


All times are GMT. The time now is 07:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01033 seconds
  • Memory Usage 1,709KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete