vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   What Does TABLE_PREFIX means? (https://vborg.vbsupport.ru/showthread.php?t=95666)

White_Snake 09-05-2005 01:11 AM

What Does TABLE_PREFIX means?
 
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

PHP Code:

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

would query the correct table, whereas

PHP Code:

$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 :)


All times are GMT. The time now is 09:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03555 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete