vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   HELP!! Please answer on 6/11/03, or don't expect response until 6/16/03! (https://vborg.vbsupport.ru/showthread.php?t=54206)

gengar003 06-11-2003 10:58 PM

HELP!! Please answer on 6/11/03, or don't expect response until 6/16/03!
 
Hadda put that in the title...
Ok.

how would I pull a single field from the user table, based on a certain userid, and assign it to a variable??

I'm using this:

PHP Code:

$tacemontest $DB_site->query("SELECT $th_rong_name FROM user WHERE userid='$counter'"); 

But all it returns is Resource#15 Resource#16, etc, etc, etc.

What's wrong?

Oh, $th_rong_name and $counter are variables in the script, and they do do what they should.

filburt1 06-11-2003 11:04 PM

Search and ye shall find. :)

gengar003 06-11-2003 11:07 PM

.........*explodes*


Right.

EDIT: I can't find it.
EDIT2: Ah.

Quote:

PHP Code:

$userinfo $DB_site->query_first("SELECT * FROM user WHERE userid=1"); 


I assume would be changed to:

PHP Code:

$tacemontest $DB_site->query_first("SELECT $th_rong_name FROM user WHERE userid=$counter"); 

Right?


EDIT3: Wrong.

I'm using
PHP Code:

$tacemontest $DB_site->query_first("SELECT '$th_rong_name' FROM user WHERE userid='$counter'"); 

And instead of resource#x, y, z, etc, now it just generates the string "Array" endlessly.

filburt1 06-11-2003 11:26 PM

That's because it's an array :p reference it via $arrayname['keyname'].

gengar003 06-11-2003 11:29 PM

Hm... so, instead of

PHP Code:

echo $tacemontest


I'd want

PHP Code:

echo $tacemontest[$th_rong_name]; 

???

gengar003 06-12-2003 12:10 AM

New thing:

Okay, how do I pull the VALUE of that ? I'ts just returning the name...


All times are GMT. The time now is 04:47 PM.

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.01057 seconds
  • Memory Usage 1,734KB
  • 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
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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