PDA

View Full Version : plz help with new_forum_sql.php


Funky
05-17-2008, 03:00 PM
Hi
i have this SQL


ALTER TABLE `phpbb_users` ADD `user_color_group` MEDIUMINT UNSIGNED NOT NULL ;
ALTER TABLE `phpbb_color_groups` ADD `hidden` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_color_groups` ADD `order_num` MEDIUMINT NOT NULL ;
ALTER TABLE `phpbb_groups` ADD `group_color_group` MEDIUMINT UNSIGNED NOT NULL ;



and i change it to


$sql[] = "ALTER TABLE {$accessname}_users` ADD `user_color_group` MEDIUMINT UNSIGNED NOT NULL ;
$sql[] = "ALTER TABLE {$accessname}_groups` ADD `group_color_group` MEDIUMINT UNSIGNED NOT NULL ;
$sql[] = "ALTER TABLE {$accessname}_color_groups` ADD `order_num` MEDIUMINT NOT NULL ;
$sql[] = "ALTER TABLE {$accessname}_color_groups` ADD `hidden` TINYINT( 1 ) DEFAULT '0' NOT NULL ;


and not working

he give me

Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/xxx/public_html/xxx/nbs/new_forum_sql.php on line 525


anyone can help me plz

Derek
05-18-2008, 10:15 PM
You are missing a ` before {$accessname}

{$accessname} should be " . $accessname . "

Also at the end of each line you are missing ";

Funky
05-19-2008, 08:25 AM
umm
okay thanks

before i change it



CREATE TABLE `phpbb_color_groups
` (
`group_id` mediumint(8) unsigned NOT NULL auto_increment,
`group_name` varchar(255) NOT NULL default '',
`group_color` varchar(50) NOT NULL default '',
PRIMARY KEY (`group_id`),
UNIQUE KEY `group_name` (`group_name`)
) TYPE=MyISAM ;
ALTER TABLE `phpbb_users` ADD `user_color_group` MEDIUMINT UNSIGNED NOT NULL

;
ALTER TABLE `phpbb_color_groups` ADD `hidden` TINYINT( 1 ) DEFAULT '0' NOT NULL

;
ALTER TABLE `phpbb_color_groups` ADD `order_num` MEDIUMINT NOT NULL

;
ALTER TABLE `phpbb_groups` ADD `group_color_group` MEDIUMINT UNSIGNED NOT NULL

;

after


$sql[] = "
CREATE TABLE " . $accessname . "_color_groups` (
`group_id` mediumint(8) unsigned NOT NULL auto_increment,
`group_name` varchar(255) NOT NULL default '',
`group_color` varchar(50) NOT NULL default '',
PRIMARY KEY (`group_id`),
UNIQUE KEY `group_name` (`group_name`)
) TYPE=MyISAM ;
);";


$sql[] = "ALTER TABLE " . $accessname . "_users` ADD `user_color_group` MEDIUMINT UNSIGNED NOT NULL ;
$sql[] = "ALTER TABLE " . $accessname . "_color_groups` ADD `hidden` TINYINT( 1 ) DEFAULT '0' NOT NULL ;
$sql[] = "ALTER TABLE " . $accessname . "_color_groups` ADD `order_num` MEDIUMINT NOT NULL ;
$sql[] = "ALTER TABLE " . $accessname . "_groups` ADD `group_color_group` MEDIUMINT UNSIGNED NOT NULL ;


I got database erorr
Am I wrong with something

http://i47.servimg.com/u/f47/11/97/60/63/jjh10.jpg

Derek
05-21-2008, 12:35 AM
In the create table query, try removing the ;) after TYPE=MYISAM

Make sure you leave ;"; at the end of it though...

Funky
06-05-2008, 11:37 PM
Thank u very much Derek

u can close the thread