sscanf with MYSQL
#1

Hello guys, I have a problem when I try to load data from a mysql database.


Код:
//Part 1
		format(queryEX,512,"SELECT `Name`,`Money`,`Bank` FROM `players` WHERE `id`='%d'",PlayerInfo[playerid][pSQLID]);

		mysql_query(queryEX);
		mysql_store_result();
		mysql_fetch_row_format(resultEX,"|");
		mysql_free_result();
		sscanf(resultEX,"p|sdd",
		PlayerInfo[playerid][pName],
		PlayerInfo[playerid][pMoney],
		PlayerInfo[playerid][pBank]

//Part2

		format(queryEX,512,"SELECT `Sex`,`Origin` FROM `players` WHERE `id`='%d'",PlayerInfo[playerid][pSQLID]);

		mysql_query(queryEX);
		mysql_store_result();
		mysql_fetch_row_format(resultEX,"|");
		mysql_free_result();
		sscanf(resultEX,"p|dd",
		PlayerInfo[playerid][pSex],
		PlayerInfo[playerid][pOrigin]
The problem is when I load the Part 2 it puts in PlayerInfo[playerid][pSex] the `Name` from the Part1.
Is there a way to fix this? I don't want to load all the parameters in one string.

Thank you guys!
Reply


Messages In This Thread
sscanf with MYSQL - by Kyleee - 07.07.2010, 14:35
Re: sscanf with MYSQL - by Kyleee - 07.07.2010, 14:41

Forum Jump:


Users browsing this thread: 2 Guest(s)