08.11.2009, 22:03
Could someone help me and tell me what is wrong here:
(Windows sa-mp server with MySQL)
public OnPlayerLogin(playerid)
{
new query[256];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
mysql_real_escape_string(pname, pname);
MySQLCheck();
format(query, sizeof(query), "SELECT * FROM `"TABLENAME"` WHERE account_name = '%s'", pname);
$result = mysql_query(query, CONNECT_THREAD_ID);
mysql_store_result();
while ($row = mysql_fetch_row($result)){
PlayerInfo[playerid][account_id] = $row[account_id];
PlayerInfo[playerid][account_name] = $row[account_name];
}
}
I bolded the potential problem areas. I am not sure, however, how to change this to make it work correctly. Please help!! Thanks!
Error report:
Line 2803 is "while ($row = mysql_fetch_row($result)){"
(Windows sa-mp server with MySQL)
public OnPlayerLogin(playerid)
{
new query[256];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
mysql_real_escape_string(pname, pname);
MySQLCheck();
format(query, sizeof(query), "SELECT * FROM `"TABLENAME"` WHERE account_name = '%s'", pname);
$result = mysql_query(query, CONNECT_THREAD_ID);
mysql_store_result();
while ($row = mysql_fetch_row($result)){
PlayerInfo[playerid][account_id] = $row[account_id];
PlayerInfo[playerid][account_name] = $row[account_name];
}
}
I bolded the potential problem areas. I am not sure, however, how to change this to make it work correctly. Please help!! Thanks!
Error report:
Quote:
pwn(2803) : error 029: invalid expression, assumed zero pwn(2803) : error 017: undefined symbol "row" pwn(2803) : error 029: invalid expression, assumed zero pwn(2803) : fatal error 107: too many error messages on one line |