johann_83 Posted February 26, 2010 Share Posted February 26, 2010 Hi everyone im new to this forum as from today but i need some help here. I have a phpnuke 8 site @ www.toe-clan.com its a cod4 clan site. I just made it and doing some mods but i want to add a integrated shoutbox to the forum and yea forum only like in the old phpbb2 etc. i cant find any good one so i tried to install an old one that is for phpbb2 and after editing all the files it it shows and all seems good but then the problem appears. I cant seem to create the sql table for it. the update file dont work now only in phpbb2 but the sql code in that file looks like follows: $sql=array( "CREATE TABLE ".SHOUTBOX_TABLE." ( shout_id MEDIUMINT( UNSIGNED NOT NULL auto_increment, shout_username VARCHAR(25) NOT NULL, shout_user_id MEDIUMINT( NOT NULL, shout_group_id MEDIUMINT( NOT NULL, shout_session_time INT(11) NOT NULL, shout_ip CHAR( NOT NULL, shout_text TEXT NOT NULL, shout_active MEDIUMINT( NOT NULL, enable_bbcode TINYINT (1) NOT NULL, enable_html TINYINT (1) NOT NULL, enable_smilies TINYINT (1) NOT NULL, enable_sig TINYINT (1) NOT NULL, shout_bbcode_uid VARCHAR(10) NOT NULL, INDEX (shout_id) )", "INSERT INTO ".CONFIG_TABLE." (config_name, config_value) VALUES ('prune_shouts', '0')", ); $mods = array ( 'fully integrated shoutbox','fully integrated shoutbox','fully integrated shoutbox' ); Idk if im asking at the right place though php sql the same lol? however i would appreciate a little help here. Thanks in advance Johan Edit: now saw the sql database section on this site im sorry for posting in wrong place Quote Link to comment https://forums.phpfreaks.com/topic/193516-a-php-noob-needs-some-help-pls/ Share on other sites More sharing options...
Clarkeez Posted February 27, 2010 Share Posted February 27, 2010 That makes a table in your sql DB, I still don't see what your problem is :S Quote Link to comment https://forums.phpfreaks.com/topic/193516-a-php-noob-needs-some-help-pls/#findComment-1018790 Share on other sites More sharing options...
johann_83 Posted February 27, 2010 Author Share Posted February 27, 2010 This is what happens Fel SQL-fråga: $sql = array( "CREATE TABLE ".SHOUTBOX_TABLE. " ( shout_id MEDIUMINT( UNSIGNED NOT NULL auto_increment, shout_username VARCHAR(25) NOT NULL, shout_user_id MEDIUMINT( NOT NULL, shout_group_id MEDIUMINT( NOT NULL, shout_session_time INT(11) NOT NULL, shout_ip CHAR( NOT NULL, shout_text TEXT NOT NULL, shout_active MEDIUMINT( NOT NULL, enable_bbcode TINYINT (1) NOT NULL, enable_html TINYINT (1) NOT NULL, enable_smilies TINYINT (1) NOT NULL, enable_sig TINYINT (1) NOT NULL, shout_bbcode_uid VARCHAR(10) NOT NULL, INDEX (shout_id) )", "INSERT INTO ".CONFIG_TABLE. " (config_name, config_value) VALUES ('prune_shouts', '0')", ); MySQL sa: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$sql=array( "CREATE TABLE ".SHOUTBOX_TABLE." ( shout_id MEDIUMINT( UNSIGNED ' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/193516-a-php-noob-needs-some-help-pls/#findComment-1018879 Share on other sites More sharing options...
xoligy Posted February 27, 2010 Share Posted February 27, 2010 This is what happens Fel SQL-fråga: $sql = array( "CREATE TABLE ".SHOUTBOX_TABLE. " ( shout_id MEDIUMINT( UNSIGNED NOT NULL auto_increment, shout_username VARCHAR(25) NOT NULL, shout_user_id MEDIUMINT( NOT NULL, shout_group_id MEDIUMINT( NOT NULL, shout_session_time INT(11) NOT NULL, shout_ip CHAR( NOT NULL, shout_text TEXT NOT NULL, shout_active MEDIUMINT( NOT NULL, enable_bbcode TINYINT (1) NOT NULL, enable_html TINYINT (1) NOT NULL, enable_smilies TINYINT (1) NOT NULL, enable_sig TINYINT (1) NOT NULL, shout_bbcode_uid VARCHAR(10) NOT NULL, INDEX (shout_id) )", "INSERT INTO ".CONFIG_TABLE. " (config_name, config_value) VALUES ('prune_shouts', '0')", ); MySQL sa: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$sql=array( "CREATE TABLE ".SHOUTBOX_TABLE." ( shout_id MEDIUMINT( UNSIGNED ' at line 1 The table is incomplete. this: shout_id MEDIUMINT( UNSIGNED NOT NULL auto_increment, should be soemting like this: shout_id MEDIUMINT(50) UNSIGNED NOT NULL auto_increment, there are a few like this if you look through it, there are just numbers missing, fill them in with what you think are necassary well i think thats the problem just re-checked the first post maybe im wrong :/ Quote Link to comment https://forums.phpfreaks.com/topic/193516-a-php-noob-needs-some-help-pls/#findComment-1018888 Share on other sites More sharing options...
PFMaBiSmAd Posted February 27, 2010 Share Posted February 27, 2010 The sql in the later post is missing some of the characters because they were converted to smiley figures because the code was not posted inside of ... tags. The sql error means that you attempted to execute the PHP code that you posted (the $sql = array(.. .. ..); statement) directly against your database as though it was sql statements. You would need to just use the sql statement - CREATE TABLE SHOUTBOX_TABLE ( shout_id MEDIUMINT( UNSIGNED NOT NULL auto_increment, shout_username VARCHAR(25) NOT NULL, shout_user_id MEDIUMINT( NOT NULL, shout_group_id MEDIUMINT( NOT NULL, shout_session_time INT(11) NOT NULL, shout_ip CHAR( NOT NULL, shout_text TEXT NOT NULL, shout_active MEDIUMINT( NOT NULL, enable_bbcode TINYINT (1) NOT NULL, enable_html TINYINT (1) NOT NULL, enable_smilies TINYINT (1) NOT NULL, enable_sig TINYINT (1) NOT NULL, shout_bbcode_uid VARCHAR(10) NOT NULL, INDEX (shout_id) ) Quote Link to comment https://forums.phpfreaks.com/topic/193516-a-php-noob-needs-some-help-pls/#findComment-1018892 Share on other sites More sharing options...
johann_83 Posted February 28, 2010 Author Share Posted February 28, 2010 ok worked just fine now thx all for youre help =) Quote Link to comment https://forums.phpfreaks.com/topic/193516-a-php-noob-needs-some-help-pls/#findComment-1019306 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.