[MySQL] - Unknown Gamemode - 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: [MySQL] - Unknown Gamemode (
/showthread.php?tid=457679)
[MySQL] - Unknown Gamemode -
cpbarn - 12.08.2013
Hey,
I recently implemented MySQL into my script and it compiles without errors and it connects to my DB as it should, but the Gamemode doesn't load properly.
I've fiddled a bit with what could be the error and I figured out that the following query "blocks" for my gamemode to function (returns 'Unknown' at gamemode name etc).
pawn Код:
mysql_query(
"CREATE TABLE IF NOT EXISTS `Users` ("\
"`AccID` int(10) NOT NULL AUTO_INCREMENT,"\
"`Username` varchar(24) NOT NULL,"\
"`Password` varchar(64) NOT NULL,"\
"`IP` varchar(16) NULL,"\
"`Cash` int(20) NULL,"\
"`Kills` int(20) NULL,"\
"`Deaths` int(20) NULL,"\
"`Adminlevel` int(20) NULL,"\
"`Donator` int(20) NULL,"\
"`Score` int(20) NULL,"\
"`Banned` int(20) NULL,"\
"`Muted` int(20) NULL,"\
"`MuteTime` int(20) NULL,"\
"PRIMARY KEY (`AccID`)"\
") ENGINE=InnoDB DEFAULT CHARSET=latin1;");
if(mysql_ping() > -1) return print("::DBCONNECT:: MySQL connection to database succeeded!");
I'm quite new at all this MySQL hype, so I am most likely doing something wrong. If you need any other information, feel free to ask! The one who can help me with this will of course be repped!
Re: [MySQL] - Unknown Gamemode -
Kingunit - 12.08.2013
Honestly, I find this a old method to create a table. Might be my opinion but I recommend to create a new table in PHPMyAdmin.
Re: [MySQL] - Unknown Gamemode -
cpbarn - 12.08.2013
You're right lol. It made my GameMode load properly after removing it - I guess it doesn't need to check/write those tables at every gamemodeinit xD
Re: [MySQL] - Unknown Gamemode -
SuperViper - 12.08.2013
If you still want to do it your way, remove all of the unnecessary double quotes in the middle of the query. It should only be at the beginning and the end.