MySQL Query Result
#5

I have no clue what you're doing in your MySQL query or whatever, I just re-wrote it for you, to save all the trouble. :}

pawn Код:
new
     Escape[2][50],
     Field[9],
     mycash;

mysql_real_escape_strig(playername2, Escape[0]);
mysql_real_escape_strig(passnow, Escape[1]);
format(string1,sizeof(string1),"SELECT * FROM `users` WHERE `username` = '%s' AND `password` = '%s'",Escape[0], Escape[1]);
mysql_query(string1);
mysql_store_result();
if(mysql_retrieve_row()) {
     mysql_get_field("cash", Field);
     mycash = strval(Field);
}
mysql_free_result();
format(string, sizeof(string), "Cash Loaded, you have $ %s", mycash );
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid,mycash );
Reply


Messages In This Thread
MySQL Query Result - by Reynolds - 08.07.2010, 10:09
Re: MySQL Query Result - by Niixie - 08.07.2010, 10:44
Re: MySQL Query Result - by Reynolds - 08.07.2010, 13:10
Re: MySQL Query Result - by Kastranova - 08.07.2010, 13:29
Re: MySQL Query Result - by Carlton - 08.07.2010, 13:35
Re: MySQL Query Result - by Kastranova - 08.07.2010, 13:47
Re: MySQL Query Result - by Niixie - 08.07.2010, 14:04

Forum Jump:


Users browsing this thread: 5 Guest(s)