View Full Version : table prefix screwing with my mod
killa seven
09-05-2010, 02:32 AM
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:
FROM " . TABLE_PREFIX . "blog_text AS blog_text
killa seven
09-05-2010, 03:36 AM
$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_
I think maybe you want:
("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
I think maybe you want:
("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
If you have a query in your mod, you should have the prefix in there just like vb puts it in there - example:
FROM " . TABLE_PREFIX . "blog_text AS blog_text
Lynne saves the day again x !
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.