Helppp MySQL Create Table Problem
#1

Hi i have a problem with MySQL

ERRORS:
Quote:

gm.pwn(881) : error 075: input line too long (after substitutions)
gm.pwn(882) : error 037: invalid string (possibly non-terminated string)
gm.pwn(882) : error 017: undefined symbol "CREATE"
gm.pwn(882) : error 017: undefined symbol "TABLE"
gm.pwn(882) : fatal error 107: too many error messages on one line

CODE:
Quote:

stock MySQL_SetUpTables()
{
mysql_tquery(SQL_ID, "CREATE TABLE IF NOT EXISTS `accounts` ( \
`uid` INT(11) NOT NULL AUTO_INCREMENT, \
`name` TEXT NOT NULL COLLATE 'utf8_polish_ci', \
`password` TEXT NOT NULL COLLATE 'utf8_polish_ci', \
`skinid` INT(11) NOT NULL, \
`money` INT(11) NOT NULL DEFAULT '0', \
`gender` INT(11) NOT NULL, \
`age` INT(11) NOT NULL, \
`level` INT(11) NOT NULL DEFAULT '1', \
`adminlvl` INT(11) NOT NULL DEFAULT '0', \
`lastip` TEXT NOT NULL COLLATE 'utf8_polish_ci', \
`lastonline` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, \
`createdate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, \
PRIMARY KEY (`uid`))");
return 1;
}

881 line is `lastonline`
Reply
#2

You need to use a string and then format and execute it.

Just a general question: Are you using the stock compiler?
Reply
#3

I dont know what you mean ;/ Here is all code

https://pastebin.com/vuA9sMJ8
Reply
#4

Change DATETIME to timestamp

LIKE:
PHP код:
stock MySQL_SetUpTables()
{
mysql_tquery(SQL_ID"CREATE TABLE IF NOT EXISTS `accounts` ( \
`uid` INT(11) NOT NULL AUTO_INCREMENT, \
`name` TEXT NOT NULL COLLATE 'utf8_polish_ci', \
`password` TEXT NOT NULL COLLATE 'utf8_polish_ci', \
`skinid` INT(11) NOT NULL, \
`money` INT(11) NOT NULL DEFAULT '0', \
`gender` INT(11) NOT NULL, \
`age` INT(11) NOT NULL, \
`level` INT(11) NOT NULL DEFAULT '1', \
`adminlvl` INT(11) NOT NULL DEFAULT '0', \
`lastip` TEXT NOT NULL COLLATE 'utf8_polish_ci', \
`lastonline` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, \ //here
`createdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, \ //here
PRIMARY KEY (`uid`))"
); 
return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)