01.07.2011, 10:28
Can anyone help me making a code to save a position in MYSQL please?
Thanks
Thanks
new Float:x, Float:y, Float:z, query[200];
GetPlayerPos(playerid, x, y, z);
format(query, sizeof(query), "INSERT INTO `positions` (`x`, `y`, `z`) VALUES (%f, %f, %f)", x, y, z);
mysql_query(query);
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);
new tmp[50], Float:x;
mysql_fetch_field("x", tmp); x = floatstr(tmp);
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 `playerinfo` SET `x`= '%f' AND `y`= '%f' AND `z`= '%f' WHERE `name`='%s'", x, y, z, name); mysql_query(Query); mysql_free_result();