Jump to content

A php noob needs some help pls


johann_83

Recommended Posts

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(8) UNSIGNED NOT NULL auto_increment,

shout_username VARCHAR(25) NOT NULL,

shout_user_id MEDIUMINT(8) NOT NULL,

shout_group_id MEDIUMINT(8) NOT NULL,

shout_session_time INT(11) NOT NULL,

shout_ip CHAR(8) NOT NULL,

shout_text TEXT NOT NULL,

shout_active MEDIUMINT(8) 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 :)

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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 :/

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.