12.09.2011, 18:22
Hello! like title says i want to load string from database , but my version doesn't work.
I Am Using pvars for this:
There is something wrong with this line:
but it wont load it. shows empty string, can someone help :P?
I Am Using pvars for this:
pawn Код:
new query[300], pname[24], savingstring[20],savingstring2[50];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT skoor, raha, admin, sugu, vanus, vaatamisi, registriaeg FROM kasutajad WHERE kasutajanimi = '%s'", pname);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query,"|"))
{
mysql_fetch_field_row(savingstring, "skoor"); SetPlayerScore(playerid, strval(savingstring));
mysql_fetch_field_row(savingstring, "raha"); MoneyGiven[playerid] = strval(savingstring);
mysql_fetch_field_row(savingstring, "admin"); SetPVarInt(playerid, "Admin",strval(savingstring));
mysql_fetch_field_row(savingstring, "sugu"); SetPVarInt(playerid, "Sugu",strval(savingstring));
mysql_fetch_field_row(savingstring, "vanus"); SetPVarInt(playerid, "Vanus",strval(savingstring));
mysql_fetch_field_row(savingstring, "vaatamisi"); SetPVarInt(playerid, "Vaatamisi",strval(savingstring));
mysql_fetch_field_row(savingstring2, "registriaeg"); SetPVarString(playerid,"RegDate",savingstring2);
}
pawn Код:
mysql_fetch_field_row(savingstring2, "registriaeg"); SetPVarString(playerid,"RegDate",savingstring2);