Raised This Month: $12 Target: $400
 3% 

Input line is too long[Compile error]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 02-09-2010 , 13:57   Input line is too long[Compile error]
Reply With Quote #1

PHP Code:
new const szTables[][] =  

    
"CREATE TABLE IF NOT EXISTS `d2_data` ( `player_steamid` varchar(25) NOT NULL default '', `player_ip` varchar(20) NOT NULL default '', `player_name` varchar(35) NOT NULL default '', `player_data` varchar(4096) NOT NULL default '', `player_data2` varchar(4096) NOT NULL default '', `player_data3` varchar(4096) NOT NULL default '', PRIMARY KEY  (`player_name`, `player_ip`, `player_steamid`), KEY `player_data` (`player_data`), KEY `player_data2` (`player_data2`), KEY `player_data3` (`player_data3`) ) TYPE=MyISAM;"

I've try press 'enter' after ',' , no success "possibly non-terminated string"
__________________
xbatista is offline
Send a message via Skype™ to xbatista
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-09-2010 , 13:59   Re: Input line is too long[Compile error]
Reply With Quote #2

Use \

PHP Code:
new const szTables[][] =  

    
"CREATE TABLE IF NOT EXISTS `d2_data` ( `player_steamid` varchar(25) NOT NULL default '', \
    `player_ip` varchar(20) NOT NULL default '', `player_name` varchar(35) NOT NULL default '', \
    `player_data` varchar(4096) NOT NULL default '', `player_data2` varchar(4096) NOT NULL default '', \
    `player_data3` varchar(4096) NOT NULL default '', PRIMARY KEY  (`player_name`, `player_ip`, `player_steamid`), \
    KEY `player_data` (`player_data`), KEY `player_data2` (`player_data2`), KEY `player_data3` (`player_data3`) ) TYPE=MyISAM;"



But [][] tells that a 2 dimensions array follow, and you only put a 1 dimension array, so be carefull.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 02-09-2010 , 14:01   Re: Input line is too long[Compile error]
Reply With Quote #3

PHP Code:
new const szTables[][] =  

    
"CREATE TABLE IF NOT EXISTS `d2_data` ( `player_steamid` varchar(25) NOT NULL default '', `player_ip` varchar(20) NOT NULL default '', `player_name` varchar(35) NOT NULL default '', `player_data` varchar(4096) NOT NULL default '', \
    `player_data2` varchar(4096) NOT NULL default '', `player_data3` varchar(4096) NOT NULL default '', PRIMARY KEY  (`player_name`, `player_ip`, `player_steamid`), KEY `player_data` (`player_data`), KEY `player_data2` (`player_data2`), \
    KEY `player_data3` (`player_data3`) ) TYPE=MyISAM;" 

Error: "input line too long" wtf?

Quote:
But [][] tells that a 2 dimensions array follow, and you only put a 1 dimension array, so be carefull.
It has worked, after I put more text to this array and at all it worked fine
__________________

Last edited by xbatista; 02-09-2010 at 14:07.
xbatista is offline
Send a message via Skype™ to xbatista
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 02-09-2010 , 14:42   Re: Input line is too long[Compile error]
Reply With Quote #4

You must format the string.
SnoW is offline
Send a message via MSN to SnoW
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 02-09-2010 , 14:47   Re: Input line is too long[Compile error]
Reply With Quote #5

Ohh cmon I want to use it like is, new const szTables[][]
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-09-2010 , 14:52   Re: Input line is too long[Compile error]
Reply With Quote #6

Don't know why you have to format. Anyway try this :

Code:
new const gTableCreateQuery[] =
"						\
    CREATE TABLE IF NOT EXISTS `d2_data`	\
    (						\
        `player_steamid` VARCHAR(25) NOT NULL,	\
        `player_ip` VARCHAR(20) NOT NULL,     	\
        `player_name` VARCHAR(35) NOT NULL,   	\
        `player_data` VARCHAR(4096) NOT NULL, 	\
        `player_data2` VARCHAR(4096) NOT NULL,	\
        `player_data3` VARCHAR(4096) NOT NULL,	\
        PRIMARY KEY(`player_name`,`player_ip`,`player_steamid`),\
        KEY `player_data` (`player_data`),    	\
        KEY `player_data2` (`player_data2`),  	\
        KEY `player_data3` (`player_data3`)   	\
    ) TYPE=MyISAM; 				\
";
__________________

Last edited by Arkshine; 02-10-2010 at 11:05.
Arkshine is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 02-10-2010 , 09:10   Re: Input line is too long[Compile error]
Reply With Quote #7

worked fine arky

EDIT
: Something wrong in your string :
Quote:
L 02/10/2010 - 16:29:03: [diablo2LOD.amxx] [MYSQLX] 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 'KEY `player_data` (`player_data`), KEY `player_data2` (`player_data2`), KE' at line 1
__________________

Last edited by xbatista; 02-10-2010 at 09:30.
xbatista is offline
Send a message via Skype™ to xbatista
stupok
Veteran Member
Join Date: Feb 2006
Old 02-10-2010 , 10:55   Re: Input line is too long[Compile error]
Reply With Quote #8

Read the error message. It's too long. Make it shorter, or do two separate queries.
__________________
stupok is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-10-2010 , 11:06   Re: Input line is too long[Compile error]
Reply With Quote #9

Quote:
Originally Posted by xbatista View Post
worked fine arky

EDIT
: Something wrong in your string :
Try again, I've forgot a ',' after `player_steamid`)
__________________
Arkshine is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 02-10-2010 , 12:16   Re: Input line is too long[Compile error]
Reply With Quote #10

now works, no errors and creates the table, thanks
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode