MySQL SavePlayerData
#1

Код:
#define MYSQL_HOST "localhost"
#define MYSQL_USER "root" 
#define MYSQL_PASS ""  
#define MYSQL_DB "nerp"


stock SavePlayerData(playerid)
{
	new query[512];
	GetPlayerPos(playerid, PlayerInfo[playerid][posX], PlayerInfo[playerid][posY], PlayerInfo[playerid][posZ]);
	mysql_format(MYSQL, query, sizeof(query), "UPDATE players SET `posX`='%f',`posY`='%f',`posZ`='%f' WHERE `ID`='%d'",PlayerInfo[playerid][posX], PlayerInfo[playerid][posY], PlayerInfo[playerid][posZ], PlayerInfo[playerid][pID]);
	mysql_tquery(MYSQL, query, "", ""); // ============== HERE, AT HANDLE=================
	return 1;
}
It says undefined symbol, what should i do there?
Reply
#2

You need to connect to your database first.

MYSQL = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS);

If you don't, the MYSQL connection object will be undefined.
Reply
#3

if u're using MySQL lower than R39-5, u must use new MySQL;
if not, than you must use new MySQL:MySQL;
Reply
#4

Quote:
Originally Posted by Mugala
Посмотреть сообщение
if u're using MySQL lower than R39-5, u must use new MySQL;
if not, than you must use new MySQL:MySQL;
rep++
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)