#1

When I tried this code
pawn Код:
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:
Код:
(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:
Код:
	`BannedBy` VARCHAR(25) NOT NULL,\
Line 350:
Код:
	`BanReason` VARCHAR(500) NOT NULL,\
so I split them then it runs without errors, but It's actually not working.
pawn Код:
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);
Any suggestions?
Reply
#2

Код:
strcat(string, "/* u forgot "`" */Faction` INT NOT NULL,\
but not sure tho, what does the mysql error logs say?
Reply
#3

Yea I missed this " ` " but it doesn't matter cuz I put it and still not working

and this is the mysql.log for the last connection:
Код:
[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)
it doesn't read the line of mysql_tquery
the last line it reads:
pawn Код:
if(mysql_errno() != 0) //  Line 304
    {
        print("[MySQL] Failed Connection");
        SendRconCommand("exit");
    }
    else print("[MySQL] Successfully Connected");
errors.log & warnings.log are all empty
Reply
#4

Is it even called when server starts?

As a general rule we create the necessary tables once, manually. You do not really need it.
Reply
#5

I don't see what causes it then. Are you sure the table doesn't exist? Because if it does then no changes will be made.
Reply
#6

I tried to create another table with less data and it's created, I tried to increase data lines till I got the same errors:
Код:
(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
so I started to use strcat and I found that it doesn't work, I replaced strcat with format but also not working

Conclusion: strcat is the problem

Any idea of how to solve these errors?

P.S :I've another GM that created a table with more lines than mine and it works without errors.
Reply
#7

Or use the comunity compiler which let you to have 4095 character on line instead of 512
Reply
#8

Quote:
Originally Posted by Banditul18
Посмотреть сообщение
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
Reply
#9

Quote:
Originally Posted by AhmedMohamed
Посмотреть сообщение
Yes that is
Reply
#10

Quote:
Originally Posted by AhmedMohamed
Посмотреть сообщение
Yes.

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.
Reply
#11

Quote:
Originally Posted by ComDuck
View Post
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.
Indeed. Make your table in pMA (phpMyAdmin) and then export the .SQL for later use.


--------------------------------------------------------------------------------------------------

PHP Code:
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 075input line too long (after substitutions)
(
350) : error 037invalid string (possibly non-terminated string)
(
350) : error 017undefined symbol "CREATE"
(350) : error 017undefined symbol "TABLE"
(350) : fatal error 107too many error messages on one line
Line 349
:
Code:
    `
BannedByVARCHAR(25NOT NULL,\
Line 350:
Code:
    `
BanReasonVARCHAR(500NOT NULL,\
so I split them then it runs without errorsbut 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); 
Bad use of MySQL.

PHP Code:
    `AdmDutyINT NOT NULL,\
    `
AdmNameVARCHAR(25NOT NULL,\
`
HelpLevelINT NOT NULL,\
    `
MapLeaderINT NOT NULL,\
    `
MapperINT NOT NULL,\ 
Save them in admin table with player\'s row ID (AI) and use foreign keys with constraints (CASCADE).

PHP Code:
    `PassVARCHAR(255NOT NULL,\ 
Oh boy! what password hashing are you using? NONE? Storing passwords in plain text??

PHP Code:
    `BannedINT NOT NULL,\
    `
BannedByVARCHAR(25NOT NULL,\
    `
BanReasonVARCHAR(500NOT NULL,\ 
Use a separate table for bans instead.

PHP Code:
`RegisterOnVARCHAR(128NOT NULL,\ 
Use INTEGER as type and save it as UNIX timestamps.

PHP Code:
    `IPVARCHAR(255NOT NULL,\
`
LastIPVARCHAR(255NOT NULL,\ 
I think max IP size is 16 or 18 characters, not 255.

PHP Code:
    `LoggedINT NOT NULL,\ 
Insert thinking emoji.

PHP Code:
    `Weap0INT NOT NULL,\
    `
Weap1INT NOT NULL,\
    `
Weap2INT NOT NULL,\
    `
Weap3INT NOT NULL,\
    `
Weap4INT NOT NULL,\
    `
Weap5INT NOT NULL,\
    `
Weap6INT NOT NULL,\
    `
Weap7INT NOT NULL,\
    `
Weap8INT NOT NULL,\
    `
Weap9INT NOT NULL,\
    `
Weap10INT NOT NULL,\
    `
Weap11INT NOT NULL,\
    `
Weap12INT NOT NULL,\
    `
WeapAmmo0INT NOT NULL,\
    `
WeapAmmo1INT NOT NULL,\ 
Make use of a seperate table for weapons!!!

PHP Code:
    `HouseINT NOT NULL,\
    `
House2INT NOT NULL,\
    `
RentingINT NOT NULL,\ 
Make use of house table.

PHP Code:
    `LastHourINT NOT NULL,\
    `
LastMinuteINT NOT NULL,\
    `
LastDayINT NOT NULL,\
    `
LastMonthINT NOT NULL,\
    `
LastYearINT NOT NULL,\ 
Make use of UNIX timestamps!!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)