How to I use this info? Help!

Status
Not open for further replies.

anti-human

Active Member
153
2008
0
0
How do I use this info or where do I put it, what file do I edit? Help please.

This is the same error as this thread ;

http://www.vbulletin.org/forum/showthread.php?t=119719

The broken line is this one ;



PHP:
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE " . TABLE_PREFIX . "userid=$numbersmembers[max]");


The table name is missing from the WHERE section after the table prefix.

i.e. TABLE_PREFIX . "userid should be TABLE_PREFIX . "user.userid

However, table prefix should not be used in WHERE clauses anyway, instead you should us an AS after the initial table selection, like this ;

:
PHP:
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user AS user WHERE user.userid=$numbersmembers[max]");


Finally, since only one table is actually used in this select, the table references can be dropped completely as no ambiguity is possible.



PHP:
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid=$numbersmembers[max]");
 
2 comments
Status
Not open for further replies.
Back
Top