Saving problem (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: Saving problem (MySql) (
/showthread.php?tid=562853)
Saving problem (MySql) -
ZaBraNjeNi - 12.02.2015
Hi,
I had problem with saving system, and I'm try to add in my database INSTER INTO, etc...
But, I get this error:
PHP код:
--
-- Dumping data for table `accounts`
--
INSERT INTO `accounts` ( `Name` , `Password` , `IP` , `RegStr` , `AdminLevel` , `VIPLevel` , `XP` , `Money` , `Banked` , `Kills` , `Deaths` , `Captures` , `wBought` , `wBought` , `Hours` , `Minutes` , `Seconds` , `LastPlayed` )
VALUES -- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `bans`
--
CREATE TABLE IF NOT EXISTS `bans` (
`BanID` INT( 6 ) NOT NULL ,
`Name` VARCHAR( 24 ) NOT NULL ,
`Admin` VARCHAR( 24 ) NOT NULL ,
`Reason` VARCHAR( 128 ) NOT NULL ,
`IP` VARCHAR( 16 ) NOT NULL ,
`Date` VARCHAR( 32 ) NOT NULL
) ENGINE = INNODB DEFAULT CHARSET = latin1;
MySQL says: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE IF NOT EXISTS `bans` (
`BanID` int(6) NOT NULL,
`Name` varcha' at line 20
Thanks.
Re: Saving problem (MySql) -
Misiur - 12.02.2015
In your first INSERT, you have unclosed VALUES. Either remove that insert, or add some values.
Re: Saving problem (MySql) -
asto63 - 12.02.2015
Your Insert Function is not completed!
INSERT INTO `accounts` ( `Name` , `Password` , `IP` , `RegStr` , `AdminLevel` , `VIPLevel` , `XP` , `Money` , `Banked` , `Kills` , `Deaths` , `Captures` , `wBought` , `wBought` , `Hours` , `Minutes` , `Seconds` , `LastPlayed` ) VALUES ( `Value1`, `Value2`...)
You need to put your values, if not, then this will generate a MySQL Error.
Re: Saving problem (MySql) -
ZaBraNjeNi - 12.02.2015
It wont to work. I get same error.