vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   table prefix screwing with my mod (https://vborg.vbsupport.ru/showthread.php?t=249942)

killa seven 09-05-2010 02:32 AM

table prefix screwing with my mod
 
is there a way to bypass this, my install code uses the table prefix constant, but the problem is when someone who has a prefix like vb_ the database breaks, however its all and well when i give it to someone with no table prefix, i no most people don't even use a table prefix but i need help bypassing it for people who do use one...

Lynne 09-05-2010 02:44 AM

If you have a query in your mod, you should have the prefix in there just like vb puts it in there - example:
PHP Code:

FROM " . TABLE_PREFIX . "blog_text AS blog_text 


killa seven 09-05-2010 03:36 AM

PHP Code:

$vbulletin->db->query_write("CREATE TABLE IF NOT EXISTS ".TABLE_PREFIX."`dbh_champions` (
`title_id` INT( 10 ) NOT NULL AUTO_INCREMENT ,
`title_name` VARCHAR( 50 ) NOT NULL ,
`title_holder`VARCHAR( 50 ) NOT NULL ,
`title_gif` VARCHAR( 150 ) NOT NULL ,
`title_defences` INT( 150 ) NOT NULL ,  
UNIQUE (`title_id`)
) "
); 



basically this is the code thats breaking when there is a table prefix

his prefix was vb_

kh99 09-05-2010 06:32 AM

I think maybe you want:

PHP Code:

("CREATE TABLE IF NOT EXISTS `".TABLE_PREFIX."dbh_champions` ( 

(move the single quote to in front of the TABLE_PREFIX).

borbole 09-05-2010 09:26 AM

Quote:

Originally Posted by kh99 (Post 2093994)
I think maybe you want:

PHP Code:

("CREATE TABLE IF NOT EXISTS `".TABLE_PREFIX."dbh_champions` ( 

(move the single quote to in front of the TABLE_PREFIX).

Indeed. That should fix it.

BirdOPrey5 09-05-2010 11:30 PM

Everyone who I know who uses VB uses a prefix... obviously not scientific but I don't know saying "Most people don't" is true.

Lee Roberts 02-12-2013 05:07 PM

Quote:

Originally Posted by Lynne (Post 2093945)
If you have a query in your mod, you should have the prefix in there just like vb puts it in there - example:
PHP Code:

FROM " . TABLE_PREFIX . "blog_text AS blog_text 


Lynne saves the day again x !


All times are GMT. The time now is 04:11 PM.

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.02367 seconds
  • Memory Usage 1,728KB
  • 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
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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