Error with mysql_query
#1

Hello. I have a problem with mysql_query. And error is (40) : error 035: argument type mismatch (argument 1). 40 line is mysql_query(query); And I don't know problem with that. Can you explain it to me ?

Код:
public OnPlayerDisconnect(playerid)
{
new Float:x, Float:y, Float:z, query[250], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerPos(playerid, x, y, z);
format(query, sizeof(query), "UPDATE `positions` SET `x`=%f AND `y`=%f AND `z`=%f WHERE `name`='%s'", x, y, z, name);
mysql_query(query);
return 1;
}
Reply
#2

You're using the AND condition incorrectly. Here's a tutorial that explains the usage.

PHP код:
format(querysizeof(query), "UPDATE positions SET x = %f, Y = %f, Z = %f WHERE name = '%e'); 
Reply
#3

Still same error.
Reply
#4

The errors from mysql_query.

Parameters:
Код:
(conhandle, query[], bool:use_cache = true)
You're missing your connection handle.
Reply
#5

Use mysql_tquery or mysql_pquery unless you know what you're doing.

https://sampwiki.blast.hk/wiki/MySQL/R40#mysql_query
Reply
#6

You are missing connection handle argument (first argument).
Reply
#7

Quote:
Originally Posted by raydx
Посмотреть сообщение
You are missing connection handle argument (first argument).
:thinking:
Reply
#8

Thanks guy for help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)