SA-MP Forums Archive
Question about a mysql query - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Question about a mysql query (/showthread.php?tid=252618)



Question about a mysql query - DerrydBrincat - 02.05.2011

Just started using gstylezzzz's plugin. Why doesn't this code work, guys? All variables have been defined, don't worry.

pawn Код:
format(sql, sizeof(sql), "SELECT * FROM players WHERE Name = '%s'", playername2);
    mysql_query(sql);
    mysql_store_result();
    while(mysql_fetch_row(row))
    {
    split(row, fields, '|');
    PlayerInfo[playerid][pLevel] = strval(fields[3]);
    PlayerInfo[playerid][pAdmin] = strval(fields[4]);
    PlayerInfo[playerid][pDonateRank] = strval(fields[5]);
        PlayerInfo[playerid][pConnectTime] = strval(fields[6]);
        PlayerInfo[playerid][pReg] = strval(fields[7]);
        PlayerInfo[playerid][pSex] = strval(fields[8]);
    }
After this code, it's supposed to obviously log them into the server, send them a message, etc. But it's as if this code is returning 1. The mysql log shows everything to be successful, the query, storing and fetching.


Re: Question about a mysql query - Alby Fire - 02.05.2011

pawn Код:
while(mysql_fetch_row_format(row,"|"))