mysql_tquery(mysql, "CREATE TABLE IF NOT EXISTS `playerdata` (\
`ID` INT NOT NULL AUTO_INCREMENT,\
`Level` INT NOT NULL,\
`NormalName` VARCHAR(25) NOT NULL,\
`AdmLevel` INT NOT NULL,\
`AdmDuty` INT NOT NULL,\
`AdmName` VARCHAR(25) NOT NULL,\
`HelpLevel` INT NOT NULL,\
`Pass` VARCHAR(255) NOT NULL,\
`Email` VARCHAR(128) NOT NULL,\
`RegisterOn` VARCHAR(128) NOT NULL,\
`MapLeader` INT NOT NULL,\
`Mapper` INT NOT NULL,\
`Donator` INT NOT NULL,\
`Banned` INT NOT NULL,\
`BannedBy` VARCHAR(25) NOT NULL,\
`BanReason` VARCHAR(500) NOT NULL,\
`IP` VARCHAR(255) NOT NULL,\
`Logged` INT NOT NULL,\
`Age` INT NOT NULL,\
`Gender` INT NOT NULL,\
`Skin` INT NOT NULL,\
`LastPosX` FLOAT NOT NULL,\
`LastPosY` FLOAT NOT NULL,\
`LastPosZ` FLOAT NOT NULL,\
`LastPosA` FLOAT NOT NULL,\
`LastInt` INT NOT NULL,\
`LastVw` INT NOT NULL,\
`Warns` INT NOT NULL,\
`Gang` INT NOT NULL,\
`Faction` INT NOT NULL,\
`FactDuty` INT NOT NULL,\
`Leader` INT NOT NULL,\
`Rank` INT NOT NULL,\
`Job` INT NOT NULL,\
`Job2` INT NOT NULL,\
`Money` INT NOT NULL,\
`Bank` INT NOT NULL,\
`Crimes` INT NOT NULL,\
`Arrested` INT NOT NULL,\
`WantedLevel` INT NOT NULL,\
`Health` FLOAT NOT NULL,\
`Armour` FLOAT NOT NULL,\
`Pot` INT NOT NULL,\
`Cocaine` INT NOT NULL,\
`Package` INT NOT NULL,\
`Crate` INT NOT NULL,\
`Radio` INT NOT NULL,\
`RadioFreq` INT NOT NULL,\
`PhoneBook` INT NOT NULL,\
`Mats` INT NOT NULL,\
`Rope` INT NOT NULL,\
`Weap0` INT NOT NULL,\
`Weap1` INT NOT NULL,\
`Weap2` INT NOT NULL,\
`Weap3` INT NOT NULL,\
`Weap4` INT NOT NULL,\
`Weap5` INT NOT NULL,\
`Weap6` INT NOT NULL,\
`Weap7` INT NOT NULL,\
`Weap8` INT NOT NULL,\
`Weap9` INT NOT NULL,\
`Weap10` INT NOT NULL,\
`Weap11` INT NOT NULL,\
`Weap12` INT NOT NULL,\
`WeapAmmo0` INT NOT NULL,\
`WeapAmmo1` INT NOT NULL,\
`House` INT NOT NULL,\
`House2` INT NOT NULL,\
`Renting` INT NOT NULL,\
`Jailed` INT NOT NULL,\
`JailTime` INT NOT NULL,\
`JailedBy` VARCHAR(25) NOT NULL,\
`JailReason` VARCHAR(500) NOT NULL,\
`HasReport` INT NOT NULL,\
`ReportContent` VARCHAR(500) NOT NULL,\
`ReviewingReport` INT NOT NULL,\
`Accent` INT NOT NULL,\
`NewbMute` INT NOT NULL,\
`togNewbie` INT NOT NULL,\
`OOCMute` INT NOT NULL,\
`togOOC` INT NOT NULL,\
`AdMute` INT NOT NULL,\
`NormMute` INT NOT NULL,\
`Married` INT NOT NULL,\
`MarriedTo` VARCHAR(25) NOT NULL,\
`ReferredBy` VARCHAR(25) NOT NULL,\
`Tokens` INT NOT NULL,\
`RequestedHelp` INT NOT NULL,\
`HelpReason` VARCHAR(500) NOT NULL,\
`LastHour` INT NOT NULL,\
`LastMinute` INT NOT NULL,\
`LastDay` INT NOT NULL,\
`LastMonth` INT NOT NULL,\
`LastYear` INT NOT NULL,\
`LastIP` VARCHAR(255) NOT NULL,\
PRIMARY KEY (`ID`))");
(349) : error 075: input line too long (after substitutions) (350) : error 037: invalid string (possibly non-terminated string) (350) : error 017: undefined symbol "CREATE" (350) : error 017: undefined symbol "TABLE" (350) : fatal error 107: too many error messages on one line
`BannedBy` VARCHAR(25) NOT NULL,\
`BanReason` VARCHAR(500) NOT NULL,\
new string[5000];
strcat(string,"CREATE TABLE IF NOT EXISTS `playerdata` (\
`ID` INT NOT NULL AUTO_INCREMENT,\
`Level` INT NOT NULL,\
`NormalName` VARCHAR(25) NOT NULL,\
`AdmLevel` INT NOT NULL,\
`AdmDuty` INT NOT NULL,\
`AdmName` VARCHAR(25) NOT NULL,\
`HelpLevel` INT NOT NULL,\
`Pass` VARCHAR(255) NOT NULL,\
`Email` VARCHAR(128) NOT NULL,\
`RegisterOn` VARCHAR(128) NOT NULL,\
`MapLeader` INT NOT NULL,\
`Mapper` INT NOT NULL,\
`Donator` INT NOT NULL,\
`Banned` INT NOT NULL,");
strcat(string, "`BannedBy` VARCHAR(25) NOT NULL,\
`BanReason` VARCHAR(500) NOT NULL,\
`IP` VARCHAR(255) NOT NULL,\
`Logged` INT NOT NULL,\
`Age` INT NOT NULL,\
`Gender` INT NOT NULL,\
`Skin` INT NOT NULL,\
`LastPosX` FLOAT NOT NULL,\
`LastPosY` FLOAT NOT NULL,\
`LastPosZ` FLOAT NOT NULL,\
`LastPosA` FLOAT NOT NULL,\
`LastInt` INT NOT NULL,\
`LastVw` INT NOT NULL,\
`Warns` INT NOT NULL,\
`Gang` INT NOT NULL,");
strcat(string, "Faction` INT NOT NULL,\
`FactDuty` INT NOT NULL,\
`Leader` INT NOT NULL,\
`Rank` INT NOT NULL,\
`Job` INT NOT NULL,\
`Job2` INT NOT NULL,\
`Money` INT NOT NULL,\
`Bank` INT NOT NULL,\
`Crimes` INT NOT NULL,\
`Arrested` INT NOT NULL,\
`WantedLevel` INT NOT NULL,\
`Health` FLOAT NOY NULL,\
`Armour` FLOAT NOT NULL,\
`Pot` INT NOT NULL,\
`Cocaine` INT NOT NULL,\
`Package` INT NOT NULL,\
`Crate` INT NOT NULL,\
`Radio` INT NOT NULL,\
`RadioFreq` INT NOT NULL,\
`PhoneBook` INT NOT NULL,");
strcat(string, "`Mats` INT NOT NULL,\
`Rope` INT NOT NULL,\
`Weap0` INT NOT NULL,\
`Weap1` INT NOT NULL,\
`Weap2` INT NOT NULL,\
`Weap3` INT NOT NULL,\
`Weap4` INT NOT NULL,\
`Weap5` INT NOT NULL,\
`Weap6` INT NOT NULL,\
`Weap7` INT NOT NULL,\
`Weap8` INT NOT NULL,\
`Weap9` INT NOT NULL,\
`Weap10` INT NOT NULL,\
`Weap11` INT NOT NULL,\
`Weap12` INT NOT NULL,\
`WeapAmmo0` INT NOT NULL,\
`WeapAmmo1` INT NOT NULL,\
`House` INT NOT NULL,\
`House2` INT NOT NULL,\
`Renting` INT NOT NULL,\
`Jailed` INT NOT NULL,");
strcat(string, "`JailTime` INT NOT NULL,\
`JailedBy` VARCHAR(25) NOT NULL,\
`JailReason` VARCHAR(500) NOT NULL,\
`HasReport` INT NOT NULL,\
`ReportContent` VARCHAR(500) NOT NULL,\
`ReviewingReport` INT NOT NULL,\
`Accent` INT NOT NULL,\
`NewbMute` INT NOT NULL,\
`togNewbie` INT NOT NULL,\
`OOCMute` INT NOT NULL,\
`togOOC` INT NOT NULL,\
`AdMute` INT NOT NULL,\
`NormMute` INT NOT NULL,\
`Married` INT NOT NULL,\
`MarriedTo` VARCHAR(25) NOT NULL,\
`ReferredBy` VARCHAR(25) NOT NULL,\
`Tokens` INT NOT NULL,");
strcat(string, "`RequestedHelp` INT NOT NULL,\
`HelpReason` VARCHAR(500) NOT NULL,\
`LastHour` INT NOT NULL,\
`LastMinute` INT NOT NULL,\
`LastDay` INT NOT NULL,\
`LastMonth` INT NOT NULL,\
`LastYear` INT NOT NULL,\
`LastIP` VARCHAR(255) NOT NULL,\
PRIMARY KEY (`ID`))");
mysql_tquery(mysql, string);
strcat(string, "/* u forgot "`" */Faction` INT NOT NULL,\
[14:36:37] [INFO] changed log level from 'warning, error' to 'debug, info, warning, error' [14:36:37] [DEBUG] mysql_connect("localhost", {UN}, "*****", {DBNAME}, 0) (G:\Learning Samp Scripting\RP\gamemodes\Roleplay.pwn:303) [14:36:37] [DEBUG] CHandleManager::Create(this=0x72aaa0, host='localhost', user='{UN}', pass='****', db='{DBNAME}', options=0x7207b8) [14:36:37] [INFO] Creating new connection handle... [14:36:37] [DEBUG] CConnection::CConnection(this=0x72f100, host='localhost', user='{UN}', passw='****', db='{DBNAME}', options=0x7207b8) [14:36:37] [DEBUG] CConnection::CConnection - new connection = 0x73cd28 [14:36:37] [DEBUG] CConnection::CConnection(this=0x4a54020, host='localhost', user='{UN}', passw='****', db='{DBNAME}', options=0x7207b8) [14:36:37] [DEBUG] CConnection::CConnection - new connection = 0x73d7c8 [14:36:37] [DEBUG] CThreadedConnection::WorkerFunc(this=0x4a54020, connection=0x4a54020) [14:36:37] [DEBUG] CThreadedConnection::CThreadedConnection(this=0x4a54020, connection=0x4a54020) [14:36:37] [DEBUG] CConnectionPool::CConnectionPool(size=2, this=0x72f780) [14:36:37] [DEBUG] CConnection::CConnection(this=0x4c26020, host='localhost', user='{UN}', passw='****', db='{DBNAME}', options=0x7207b8) [14:36:37] [DEBUG] CConnection::CConnection - new connection = 0x770100 [14:36:37] [DEBUG] CThreadedConnection::WorkerFunc(this=0x4c26020, connection=0x4c26020) [14:36:37] [DEBUG] CThreadedConnection::CThreadedConnection(this=0x4c26020, connection=0x4c26020) [14:36:37] [DEBUG] CConnection::CConnection(this=0x4df9020, host='localhost', user='{UN}', passw='****', db='{DBNAME}', options=0x7207b8) [14:36:37] [DEBUG] CConnection::CConnection - new connection = 0x779538 [14:36:37] [DEBUG] CThreadedConnection::WorkerFunc(this=0x4df9020, connection=0x4df9020) [14:36:37] [DEBUG] CThreadedConnection::CThreadedConnection(this=0x4df9020, connection=0x4df9020) [14:36:37] [INFO] Connection handle with id '1' successfully created. [14:36:37] [DEBUG] CHandleManager::Create - new handle = 0x733d38 [14:36:37] [DEBUG] mysql_connect: return value: '1' (G:\Learning Samp Scripting\RP\gamemodes\Roleplay.pwn:303) [14:36:37] [DEBUG] mysql_errno(1) (G:\Learning Samp Scripting\RP\gamemodes\Roleplay.pwn:304) [14:36:37] [DEBUG] CHandle::GetErrorId(this=0x733d38) [14:36:37] [DEBUG] CConnection::GetError(this=0x72f100, connection=0x73cd28) [14:36:37] [DEBUG] CHandle::GetErrorId - return value: true, error id: '0', error msg: '' [14:36:37] [DEBUG] mysql_errno: return value: '0' (G:\Learning Samp Scripting\RP\gamemodes\Roleplay.pwn:304)
if(mysql_errno() != 0) // Line 304
{
print("[MySQL] Failed Connection");
SendRconCommand("exit");
}
else print("[MySQL] Successfully Connected");
(325) : error 075: input line too long (after substitutions) (326) : error 037: invalid string (possibly non-terminated string) (326) : error 017: undefined symbol "CREATE" (326) : error 017: undefined symbol "TABLE" (326) : fatal error 107: too many error messages on one line
Or use the comunity compiler which let you to have 4095 character on line instead of 512
|
You mean this?
https://github.com/pawn-lang/compiler |
You mean this?
https://github.com/pawn-lang/compiler |
That garbled monstrosity of a SQL query makes me feel queasy. Why don\'t you use SQL directly to do what you want instead of going through an overhead like that? Since you only need to create the table once, it is practically dead code after the first run.
|
mysql_tquery(mysql, "CREATE TABLE IF NOT EXISTS `playerdata` (\
`ID` INT NOT NULL AUTO_INCREMENT,\
`Level` INT NOT NULL,\
`NormalName` VARCHAR(25) NOT NULL,\
`AdmLevel` INT NOT NULL,\
`AdmDuty` INT NOT NULL,\
`AdmName` VARCHAR(25) NOT NULL,\
`HelpLevel` INT NOT NULL,\
`Pass` VARCHAR(255) NOT NULL,\
`Email` VARCHAR(128) NOT NULL,\
`RegisterOn` VARCHAR(128) NOT NULL,\
`MapLeader` INT NOT NULL,\
`Mapper` INT NOT NULL,\
`Donator` INT NOT NULL,\
`Banned` INT NOT NULL,\
`BannedBy` VARCHAR(25) NOT NULL,\
`BanReason` VARCHAR(500) NOT NULL,\
`IP` VARCHAR(255) NOT NULL,\
`Logged` INT NOT NULL,\
`Age` INT NOT NULL,\
`Gender` INT NOT NULL,\
`Skin` INT NOT NULL,\
`LastPosX` FLOAT NOT NULL,\
`LastPosY` FLOAT NOT NULL,\
`LastPosZ` FLOAT NOT NULL,\
`LastPosA` FLOAT NOT NULL,\
`LastInt` INT NOT NULL,\
`LastVw` INT NOT NULL,\
`Warns` INT NOT NULL,\
`Gang` INT NOT NULL,\
`Faction` INT NOT NULL,\
`FactDuty` INT NOT NULL,\
`Leader` INT NOT NULL,\
`Rank` INT NOT NULL,\
`Job` INT NOT NULL,\
`Job2` INT NOT NULL,\
`Money` INT NOT NULL,\
`Bank` INT NOT NULL,\
`Crimes` INT NOT NULL,\
`Arrested` INT NOT NULL,\
`WantedLevel` INT NOT NULL,\
`Health` FLOAT NOT NULL,\
`Armour` FLOAT NOT NULL,\
`Pot` INT NOT NULL,\
`Cocaine` INT NOT NULL,\
`Package` INT NOT NULL,\
`Crate` INT NOT NULL,\
`Radio` INT NOT NULL,\
`RadioFreq` INT NOT NULL,\
`PhoneBook` INT NOT NULL,\
`Mats` INT NOT NULL,\
`Rope` INT NOT NULL,\
`Weap0` INT NOT NULL,\
`Weap1` INT NOT NULL,\
`Weap2` INT NOT NULL,\
`Weap3` INT NOT NULL,\
`Weap4` INT NOT NULL,\
`Weap5` INT NOT NULL,\
`Weap6` INT NOT NULL,\
`Weap7` INT NOT NULL,\
`Weap8` INT NOT NULL,\
`Weap9` INT NOT NULL,\
`Weap10` INT NOT NULL,\
`Weap11` INT NOT NULL,\
`Weap12` INT NOT NULL,\
`WeapAmmo0` INT NOT NULL,\
`WeapAmmo1` INT NOT NULL,\
`House` INT NOT NULL,\
`House2` INT NOT NULL,\
`Renting` INT NOT NULL,\
`Jailed` INT NOT NULL,\
`JailTime` INT NOT NULL,\
`JailedBy` VARCHAR(25) NOT NULL,\
`JailReason` VARCHAR(500) NOT NULL,\
`HasReport` INT NOT NULL,\
`ReportContent` VARCHAR(500) NOT NULL,\
`ReviewingReport` INT NOT NULL,\
`Accent` INT NOT NULL,\
`NewbMute` INT NOT NULL,\
`togNewbie` INT NOT NULL,\
`OOCMute` INT NOT NULL,\
`togOOC` INT NOT NULL,\
`AdMute` INT NOT NULL,\
`NormMute` INT NOT NULL,\
`Married` INT NOT NULL,\
`MarriedTo` VARCHAR(25) NOT NULL,\
`ReferredBy` VARCHAR(25) NOT NULL,\
`Tokens` INT NOT NULL,\
`RequestedHelp` INT NOT NULL,\
`HelpReason` VARCHAR(500) NOT NULL,\
`LastHour` INT NOT NULL,\
`LastMinute` INT NOT NULL,\
`LastDay` INT NOT NULL,\
`LastMonth` INT NOT NULL,\
`LastYear` INT NOT NULL,\
`LastIP` VARCHAR(255) NOT NULL,\
PRIMARY KEY (`ID`))");
I got these errors:
Code:
(349) : error 075: input line too long (after substitutions)
(350) : error 037: invalid string (possibly non-terminated string)
(350) : error 017: undefined symbol "CREATE"
(350) : error 017: undefined symbol "TABLE"
(350) : fatal error 107: too many error messages on one line
Line 349:
Code:
`BannedBy` VARCHAR(25) NOT NULL,\
Line 350:
Code:
`BanReason` VARCHAR(500) NOT NULL,\
so I split them then it runs without errors, but It\'s actually not working.
pawn Code:
new string[5000];
strcat(string,"CREATE TABLE IF NOT EXISTS `playerdata` (\
`ID` INT NOT NULL AUTO_INCREMENT,\
`Level` INT NOT NULL,\
`NormalName` VARCHAR(25) NOT NULL,\
`AdmLevel` INT NOT NULL,\
`AdmDuty` INT NOT NULL,\
`AdmName` VARCHAR(25) NOT NULL,\
`HelpLevel` INT NOT NULL,\
`Pass` VARCHAR(255) NOT NULL,\
`Email` VARCHAR(128) NOT NULL,\
`RegisterOn` VARCHAR(128) NOT NULL,\
`MapLeader` INT NOT NULL,\
`Mapper` INT NOT NULL,\
`Donator` INT NOT NULL,\
`Banned` INT NOT NULL,");
strcat(string, "`BannedBy` VARCHAR(25) NOT NULL,\
`BanReason` VARCHAR(500) NOT NULL,\
`IP` VARCHAR(255) NOT NULL,\
`Logged` INT NOT NULL,\
`Age` INT NOT NULL,\
`Gender` INT NOT NULL,\
`Skin` INT NOT NULL,\
`LastPosX` FLOAT NOT NULL,\
`LastPosY` FLOAT NOT NULL,\
`LastPosZ` FLOAT NOT NULL,\
`LastPosA` FLOAT NOT NULL,\
`LastInt` INT NOT NULL,\
`LastVw` INT NOT NULL,\
`Warns` INT NOT NULL,\
`Gang` INT NOT NULL,");
strcat(string, "Faction` INT NOT NULL,\
`FactDuty` INT NOT NULL,\
`Leader` INT NOT NULL,\
`Rank` INT NOT NULL,\
`Job` INT NOT NULL,\
`Job2` INT NOT NULL,\
`Money` INT NOT NULL,\
`Bank` INT NOT NULL,\
`Crimes` INT NOT NULL,\
`Arrested` INT NOT NULL,\
`WantedLevel` INT NOT NULL,\
`Health` FLOAT NOY NULL,\
`Armour` FLOAT NOT NULL,\
`Pot` INT NOT NULL,\
`Cocaine` INT NOT NULL,\
`Package` INT NOT NULL,\
`Crate` INT NOT NULL,\
`Radio` INT NOT NULL,\
`RadioFreq` INT NOT NULL,\
`PhoneBook` INT NOT NULL,");
strcat(string, "`Mats` INT NOT NULL,\
`Rope` INT NOT NULL,\
`Weap0` INT NOT NULL,\
`Weap1` INT NOT NULL,\
`Weap2` INT NOT NULL,\
`Weap3` INT NOT NULL,\
`Weap4` INT NOT NULL,\
`Weap5` INT NOT NULL,\
`Weap6` INT NOT NULL,\
`Weap7` INT NOT NULL,\
`Weap8` INT NOT NULL,\
`Weap9` INT NOT NULL,\
`Weap10` INT NOT NULL,\
`Weap11` INT NOT NULL,\
`Weap12` INT NOT NULL,\
`WeapAmmo0` INT NOT NULL,\
`WeapAmmo1` INT NOT NULL,\
`House` INT NOT NULL,\
`House2` INT NOT NULL,\
`Renting` INT NOT NULL,\
`Jailed` INT NOT NULL,");
strcat(string, "`JailTime` INT NOT NULL,\
`JailedBy` VARCHAR(25) NOT NULL,\
`JailReason` VARCHAR(500) NOT NULL,\
`HasReport` INT NOT NULL,\
`ReportContent` VARCHAR(500) NOT NULL,\
`ReviewingReport` INT NOT NULL,\
`Accent` INT NOT NULL,\
`NewbMute` INT NOT NULL,\
`togNewbie` INT NOT NULL,\
`OOCMute` INT NOT NULL,\
`togOOC` INT NOT NULL,\
`AdMute` INT NOT NULL,\
`NormMute` INT NOT NULL,\
`Married` INT NOT NULL,\
`MarriedTo` VARCHAR(25) NOT NULL,\
`ReferredBy` VARCHAR(25) NOT NULL,\
`Tokens` INT NOT NULL,");
strcat(string, "`RequestedHelp` INT NOT NULL,\
`HelpReason` VARCHAR(500) NOT NULL,\
`LastHour` INT NOT NULL,\
`LastMinute` INT NOT NULL,\
`LastDay` INT NOT NULL,\
`LastMonth` INT NOT NULL,\
`LastYear` INT NOT NULL,\
`LastIP` VARCHAR(255) NOT NULL,\
PRIMARY KEY (`ID`))");
mysql_tquery(mysql, string);
`AdmDuty` INT NOT NULL,\
`AdmName` VARCHAR(25) NOT NULL,\
`HelpLevel` INT NOT NULL,\
`MapLeader` INT NOT NULL,\
`Mapper` INT NOT NULL,\
`Pass` VARCHAR(255) NOT NULL,\
`Banned` INT NOT NULL,\
`BannedBy` VARCHAR(25) NOT NULL,\
`BanReason` VARCHAR(500) NOT NULL,\
`RegisterOn` VARCHAR(128) NOT NULL,\
`IP` VARCHAR(255) NOT NULL,\
`LastIP` VARCHAR(255) NOT NULL,\
`Logged` INT NOT NULL,\
`Weap0` INT NOT NULL,\
`Weap1` INT NOT NULL,\
`Weap2` INT NOT NULL,\
`Weap3` INT NOT NULL,\
`Weap4` INT NOT NULL,\
`Weap5` INT NOT NULL,\
`Weap6` INT NOT NULL,\
`Weap7` INT NOT NULL,\
`Weap8` INT NOT NULL,\
`Weap9` INT NOT NULL,\
`Weap10` INT NOT NULL,\
`Weap11` INT NOT NULL,\
`Weap12` INT NOT NULL,\
`WeapAmmo0` INT NOT NULL,\
`WeapAmmo1` INT NOT NULL,\
`House` INT NOT NULL,\
`House2` INT NOT NULL,\
`Renting` INT NOT NULL,\
`LastHour` INT NOT NULL,\
`LastMinute` INT NOT NULL,\
`LastDay` INT NOT NULL,\
`LastMonth` INT NOT NULL,\
`LastYear` INT NOT NULL,\