PDA

View Full Version : HELP!! Please answer on 6/11/03, or don't expect response until 6/16/03!


gengar003
06-11-2003, 10:58 PM
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:

$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.



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



I assume would be changed to:


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


Right?


EDIT3: Wrong.

I'm using

$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


echo $tacemontest;



I'd want


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...