Reputation: 1422
$username
is the, well, username of the logged in user.
$username_query = mysql_query("SELECT userid from registerusers WHERE username = '$username'");
$username_id = mysql_fetch_row($username_query);
I'm trying to use $username_id
in another query and am testing by printing out in a page, and it always returns 'Array'. I'm really bad with MySQL and most of the research I've done has yielded overcomplicated responses and I'd just like to get a response specific to my problem so I really understand this, so I'm sorry if this is deemed a 'bad' question.
Upvotes: 0
Views: 123
Reputation: 360602
mysql_fetch_*()
functions return an array or object, representing the entire ROW of data you've fetched, even if that row consists of a single value.
Your user id value will actually be $username_id[0]
Upvotes: 1