BlueG simple MySQL load question.
#2

pawn Код:
new str[128];
format(str, sizeof(str), "SELECT * FROM Cars WHERE Ownerid = '%d'", UserStats[playerid][Uniqueid]);
mysql_query(str);
mysql_store_result();
while(mysql_retrieve_row())
{
    new row[128];
    new field[5][128];
    mysql_fetch_row_format(row, "|");
    print(row); //See what this prints and if it even pritns
    explode(row, field, "|"); //sscanf is probably better than explode.
    CarStats[playerid][Unid][i] = strval(field[0]);
    CarStats[playerid][Carid][i] = strval(field[1]);
    CarStats[playerid][Ownerid][i] = strval(field[2]);
    CarStats[playerid][Color1][i] = strval(field[3]);
    CarStats[playerid][Color2][i] = strval(field[4]);
}
mysql_free_result();
Reply


Messages In This Thread
BlueG simple MySQL load question. - by Kaaajmak - 04.01.2013, 19:37
Re: BlueG simple MySQL load question. - by [HiC]TheKiller - 04.01.2013, 19:40
Re: BlueG simple MySQL load question. - by Vince - 04.01.2013, 19:57
Re: BlueG simple MySQL load question. - by Kaaajmak - 04.01.2013, 20:03
Re: BlueG simple MySQL load question. - by Kaaajmak - 04.01.2013, 20:06

Forum Jump:


Users browsing this thread: 1 Guest(s)