Problem Mysql
#1

Hi, I'm trying to make a system to save the houses but when testing it appears on the console:

[01:57:51] Error #1064 - Error: 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 'М¬Los Santos Civic Center)' at line 1 | Query: INSERT INTO houses (id, x, y, z, Price, Street) VALUES (2, 1377.808349, -1752.953247, 14.140625, 30, М¬Los Santos Civic Center)

the error in this line: (A part of the function)

Код:
stock AddHouse(Float:x, Float:y, Float:z, price, zone, own[]="Nobody", descripcion[]="Nothing")
{
format(query, 512, "INSERT INTO houses (id, x, y, z, Price, Street) VALUES (%d, %f, %f, %f, %d, %s)", ret, x, y, z, precio, zone);
Код:
stock GetPlayer2DZone(playerid, zone[], len){
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
 	for(new i = 0; i != sizeof(gSAZones); i++ )
 	{
		if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
		{
		    return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
		}
	}
	return 0;
}
i don't know why this happen, sorry for my bad english. :/
Reply
#2

pawn Код:
format(query, 512, "INSERT INTO houses (id, x, y, z, Price, Street) VALUES (%d, %f, %f, %f, %d, '%s')", ret, x, y, z, precio, zone);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)