You'd have to connect to the database. You can write a script that chdir()s to the forum directory then includes global.php, then you can use $vbulletin->db, or you could use the php mysql functions to go directly to the database (but you need the connection info from config.php).
Quote:
Originally Posted by DaveNGU
Code:
$ranks = $vbulletin->db->query_first("
SELECT rank
FROM ".$schema.".".$db_prefix."usertextfield
WHERE username = 'Jake'
");
I've put the username in there as a test.. but this is giving me: MySQL Error : Unknown column 'username' in 'where clause'
Is their username not stored in this table?
|
It's not, only the userid is there. But if you only have the username you could do this:
Code:
$ranks = $vbulletin->db->query_first("
SELECT rank
FROM ".$schema.".".$db_prefix."usertextfield AS usertextfield
LEFT JOIN ".$schema.".".$db_prefix."user AS user ON (user.userid = usertextfield.userid)
WHERE username = 'Jake'
");