SA-MP Forums Archive
Mysql errors... - 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 errors... (/showthread.php?tid=533229)



Mysql errors... - Metharon - 23.08.2014

Код:
szQuery[ 0 ] = EOS;	
			format( szQuery, 500, "INSERT INTO `users` (Name,Password,TAG) VALUES ('%s','%s,'%s')", GetName(playerid), PasswordInserted[playerid], TagInserted[playerid]);
	        mysql_tquery( SQL, szQuery, "", "" );
[15:53:06] [ERROR] CMySQLQuery::Execute[] - (error #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 'dad')' at line 1
[15:55:39] [ERROR] CMySQLQuery::Execute[] - (error #1054) Unknown column 'dad' in 'field list'

:/ the TagInserted is a string from inputtext...


Re: Mysql errors... - Kyance - 23.08.2014

Код:
format( szQuery, 500, "INSERT INTO `users` (Name,Password,TAG) VALUES ('%s','%s,'%s')", GetName(playerid), PasswordInserted[playerid], TagInserted[playerid]);
You're missing an '.
Try this;
Код:
format( szQuery, 500, "INSERT INTO `users` (Name,Password,TAG) VALUES ('%s','%s','%s')", GetName(playerid), PasswordInserted[playerid], TagInserted[playerid]);