PDA

View Full Version : What Does TABLE_PREFIX means?


White_Snake
09-05-2005, 01:11 AM
well i been looking this on some mods that requiere mySQL operations, but im not sure what does TABLE_PREFIX means so i would be good if someone can tell me what does it means?

btw im looking this on vb 3.5.0 RC2

Adrian Schneider
09-05-2005, 01:14 AM
It's the table prefix you used on all your vbulletin tables... you specify it when installing.

If you installed using "vb3_" then

$db->query_read("
SELECT *
FROM " . TABLE_PREFIX . "user
WHERE userid = '" . $vbulletin->userinfo['userid'] . "'
LIMIT 1
");

would query the correct table, whereas

$db->query_read("
SELECT *
FROM user
WHERE userid = '" . $vbulletin->userinfo['userid'] . "'
LIMIT 1
"); would not, because the table is called "vb3_user", not "user".

If you don't have table prefixes, it won't affect anything (because the constant is equal to "").

White_Snake
09-05-2005, 01:20 AM
i see, thanks a lot that was quick and a very clear explained too thank you :D again

Come2Daddy
09-21-2008, 11:25 AM
I came here by searching, very good answer
Thank you :)