mysql doesn't insert - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: mysql doesn't insert (
/showthread.php?tid=167683)
mysql doesn't insert -
keessie - 13.08.2010
hello
im trying to make a backup of my ini files on mysql
but i get an error with sending it to the database
Код:
CMySQLHandler::Query(INSERT INTO `playerinfo` (`user`, `password`, `money`, `adminlevel`) VALUES ('keessie', 'mypass', '0', '0',)) - An error has occured. (Error ID: 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 ')' at line 1);
it's reading from the ini file for the mypass password so that is working but when i look inside my database there is nothing
its my first try with mysql :P
can someone help me?
EDIT: the update line what comes up when a player already exist on the database works fine
Код:
format(query, sizeof(query), "UPDATE `playerinfo` SET `password` = '%d',`money` = '%d', `adminlevel` = '%d' WHERE `user` = '%s'",dini_Get(archive, "Password"), dini_Int(archive, "money"), dini_Int(archive, "Adminlevel"), Pname);