SA-MP Forums Archive
How to add a new line [MYSQL] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to add a new line [MYSQL] (/showthread.php?tid=649714)



How to add a new line [MYSQL] - NotThatWeird - 13.02.2018

Hello, how can i add a new line when i want to create my table on mysql

The code is:

PHP код:
mysql_tquery(Database"CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT,`USERNAME` varchar(24) NOT NULL,`PASSWORD` char(65) NOT NULL,`SALT` char(11) NOT NULL,`SCORE` mediumint(7), `KILLS` mediumint(7), `CASH` mediumint(7) NOT NULL DEFAULT '0',`DEATHS` mediumint(7) NOT NULL DEFAULT '0', PRIMARY KEY (`ID`), UNIQUE KEY `USERNAME` (`USERNAME`))"); 
I want to make it like this:

PHP код:
mysql_tquery(Database"CREATE TABLE IF NOT EXISTS 'PLAYERS' (
'ID' int(11) NOT NULL AUTO_INCREMENT,
'USERNAME' varchar(24) NOT NULL,
'PASSWORD' char(65) NOT NULL 
ETc.. how can i make it like that?


Re: How to add a new line [MYSQL] - Gammix - 13.02.2018

Код:
mysql_tquery(Database, "CREATE TABLE IF NOT EXISTS `PLAYERS` (\
`ID` int(11) NOT NULL AUTO_INCREMENT, \
`USERNAME` varchar(24) ...



Re: How to add a new line [MYSQL] - NotThatWeird - 13.02.2018

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Код:
mysql_tquery(Database, "CREATE TABLE IF NOT EXISTS `PLAYERS` (\
`ID` int(11) NOT NULL AUTO_INCREMENT, \
`USERNAME` varchar(24) ...
PHP код:
error 075input line too long (after substitutions)
error 037invalid string (possibly non-terminated string)
error 017undefined symbol "CREATE"
error 017undefined symbol "TABLE"
fatal error 107too many error messages on one line 
PHP код:
mysql_tquery(Database"CREATE TABLE IF NOT EXISTS `PLAYERS` (\
    `ID` int(11) NOT NULL AUTO_INCREMENT, \
      `USERNAME` varchar(24) NOT NULL, \
      `PASSWORD` char(65) NOT NULL, \
      `SALT` char(11) NOT NULL, \
      `SCORE` mediumint(7), \
      `CASH` mediumint(7) NOT NULL DEFAULT '0', \
      `DEATHS` mediumint(7) NOT NULL DEFAULT '0', \
     PRIMARY KEY (`ID`), \
     UNIQUE KEY `USERNAME` (`USERNAME`))"
); 



Re: How to add a new line [MYSQL] - Gammix - 13.02.2018

Since pawnc has this limitation. You can either switch to a modern day pawn compiler like JIT;
Or you can use "strcat" and concatenate parts of your literal string into one local string variable.