SQL syntax.
#1

i have a sql syntax problem there is code:

Code:
	new Query[256], pName[35];
		new Float:x, Float:y, Float:z;

		GetPlayerName(playerid, pName, 35);
		GetPlayerPos(playerid, x, y, z);

		mysql_format(ConnectMySQL, Query, sizeof(Query), "UPDATE `aractrash` SET `tposX` = %f, `tposY` = %f, tposZ = %f, `KullaniciAdi` = %s)x, ,y ,z ,pName");
		mysql_tquery(ConnectMySQL, Query);
gives this.
Code:
error 076: syntax error in the expression, or invalid function call
Reply
#2

You have put ) instead of " and forgot ,

PHP Code:
new Query[256], pName[35];
new 
Float:xFloat:yFloat:z;
GetPlayerName(playeridpName35);
GetPlayerPos(playeridxyz);
mysql_format(ConnectMySQLQuerysizeof(Query), "UPDATE `aractrash` SET `tposX` = '%f', `tposY` = '%f', tposZ = '%f', `KullaniciAdi` = '%s'"x, ,,,pName);
mysql_tquery(ConnectMySQLQuery); 
Reply
#3

thanks but didn't work.

now gives that
PHP Code:
C:\Users\**\Desktop\3d\gamemodes\...pwn(288) : warning 215expression has no effect
C
:\Users\**\Desktop\3d\gamemodes\...pwn(288) : warning 215expression has no effect
C
:\Users\**\Desktop\3d\gamemodes\....pwn(288) : warning 215expression has no effect
C
:\Users\**\Desktop\3d\gamemodes\....pwn(288) : error 001expected token";"but found ")"
C:\Users\**\Desktop\3d\gamemodes\...pwn(288) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

PHP Code:
line 288
    mysql_format
(ConnectMySQLQuerysizeof(Query), "UPDATE `aractrash` SET `tposX` = '%f', `tposY` = '%f', tposZ = '%f', `KullaniciAdi` = '%s'"x, ,,,pName); 
Reply
#4

Quote:
Originally Posted by kovac
View Post
You have put ) instead of " and forgot ,

PHP Code:
new Query[256], pName[35];
new 
Float:xFloat:yFloat:z;
GetPlayerName(playeridpName35);
GetPlayerPos(playeridxyz);
mysql_format(ConnectMySQLQuerysizeof(Query), "UPDATE `aractrash` SET `tposX` = '%f', `tposY` = '%f', tposZ = '%f', `KullaniciAdi` = '%s'"x, ,,,pName);
mysql_tquery(ConnectMySQLQuery); 
You have one extra comma ...'%s'", x, ,y ,z ,pName);
Reply
#5

Quote:
Originally Posted by ThinAir
View Post
You have one extra comma ...'%s'", x, ,y ,z ,pName);
thanks
Reply
#6

PHP Code:
new Query[256], pName[35];
new 
Float:xFloat:yFloat:z;
GetPlayerName(playeridpName35);
GetPlayerPos(playeridxyz);
mysql_format(ConnectMySQLQuerysizeof(Query), "UPDATE aractrash SET tposX = %f, tposY = %f, tposZ = %f, KullaniciAdi = %s"xyzpName);
mysql_tquery(ConnectMySQLQuery); 
Reply
#7

Quote:
Originally Posted by ISmokezU
View Post
PHP Code:
new Query[256], pName[35];
new 
Float:xFloat:yFloat:z;
GetPlayerName(playeridpName35);
GetPlayerPos(playeridxyz);
mysql_format(ConnectMySQLQuerysizeof(Query), "UPDATE aractrash SET tposX = %f, tposY = %f, tposZ = %f, KullaniciAdi = %s"xyzpName);
mysql_tquery(ConnectMySQLQuery); 
thanks guys.
PHP Code:
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
 no errors 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)