Mysql doens't load - 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 doens't load (
/showthread.php?tid=606813)
Mysql doens't load -
IndependentGaming - 09.05.2016
hello, I have a problem with my MOTD's once I make them ingame they aren't saving after a server restart here is a screenshot when I open the table "Misc"
Please I have tried many things..
Re: Mysql doens't load -
IndependentGaming - 09.05.2016
Has anyone any idea ?
Re: Mysql doens't load -
MotherDucker - 09.05.2016
You must have a primary key within the database, when I make something like this, I use an ID column which I make the primary key
You can do this using either phpmyadmin or, using the following sql code, obviously putting the other fields in where needed
Код:
CREATE TABLE `SERVER_NAME`.`misc` ( `ID` INT AUTO_INCREMENT , `MOTD` VARCHAR , PRIMARY KEY (`ID`))
Re: Mysql doens't load -
IndependentGaming - 09.05.2016
Quote:
Originally Posted by MotherDucker
You must have a primary key within the database, when I make something like this, I use an ID column which I make the primary key
You can do this using either phpmyadmin or, using the following sql code, obviously putting the other fields in where needed
Код:
CREATE TABLE `SERVER_NAME`.`misc` ( `ID` INT AUTO_INCREMENT , `MOTD` VARCHAR , PRIMARY KEY (`ID`))
|
Like this ?
Re: Mysql doens't load -
MotherDucker - 09.05.2016
Yes that should work, however it should really be an int, so like an ID which Auto increments as primary keys cannot be NULL, that is why I always use an ID column.
Re: Mysql doens't load -
IndependentGaming - 09.05.2016
Quote:
Originally Posted by MotherDucker
Yes, that should work.
|
Well it isn't working once the server is restarted the MOTD's are blank again.
Re: Mysql doens't load -
MotherDucker - 09.05.2016
I edited the comment so read it again, but could you show me the actual script you're using that gets the motd and displays it?