$consulta = mysql_query("SELECT * FROM tabela WHERE id=1");
$PLAYER = mysql_fetch_array($consulta);
$sexo = $PLAYER['sexo_player'];
$skin = $PLAYER['skin'];
mysql_function_query(/* variavelconexao */,"SELECT * FROM tabela WHERE id=1",true,"PegarResultado","i",playerid);
forward PegarResultado(playerid);
public PegarResultado(playerid)
{
new rows,fields;
cache_get_data(rows,fields);
if(rows)
{
new temp[30];
cache_get_field_content(0,"sexo_player",temp),/* variavelsexo */ = strval(temp);
cache_get_field_content(0,"skin",temp),/* variavelskin */ = strval(temp);
}
return 1;
}
error 017: undefined symbol "cache_get_data"
error 017: undefined symbol "cache_get_field_content"
Amigo, olha os erros que deu:
pawn Код:
|
public OnPlayerRequestClass(playerid)
{
new query[300], pname[24]/*, SkinBD[2]*/;
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT * FROM contas WHERE nick = '%s'", pname);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query,"|"))
{
PegaBD(playerid);
}
mysql_free_result();
return 1;
}
public PegaBD(playerid)
{
new temp[30];
mysql_fetch_field_row(temp, "idade"); format(PlayerInfo[playerid][pIdade], 3, temp);
mysql_fetch_field_row(temp, "sexo"); format(PlayerInfo[playerid][pSexo], 3, temp);
mysql_fetch_field_row(temp, "pais"); format(PlayerInfo[playerid][pPais], 3, temp);
mysql_fetch_field_row(temp, "idioma"); format(PlayerInfo[playerid][pIdioma], 3, temp);
mysql_fetch_field_row(temp, "skin"); format(PlayerInfo[playerid][pSkin], 3, temp);
mysql_fetch_field_row(temp, "skin_sec"); format(PlayerInfo[playerid][pSkinSec], 3, temp);
mysql_fetch_field_row(temp, "dinheiro"); format(PlayerInfo[playerid][pDinheiro], 3, temp); GivePlayerMoney(playerid, PlayerInfo[playerid][pDinheiro]);
mysql_fetch_field_row(temp, "celular"); format(PlayerInfo[playerid][pCelular], 3, temp);
mysql_fetch_field_row(temp, "level"); format(PlayerInfo[playerid][pLevel], 3, temp);
mysql_fetch_field_row(temp, "horas_jogadas"); format(PlayerInfo[playerid][pHorasJogadas], 11, temp);
mysql_fetch_field_row(temp, "admin"); format(PlayerInfo[playerid][pAdmin], 1, temp);
mysql_fetch_field_row(temp, "spawn"); format(PlayerInfo[playerid][pSpawn], 3, temp);
return 1;
}
error 017: undefined symbol "mysql_query"