MYSQL problem
#1

Im trying to get the last 10 logins to show up, 'Player Name' logged in 'date and time'.
It shows me 'Richie© logged in NULL'. Why?

Field 'PlayerName' is varchar 24, 'Time' is varchar 20 in the DB.
pawn Код:
IRCCMD:lastlogins(botid, channel[], user[], host[], params[])
{
    if (IRC_IsOp(botid, channel, user))
    {
        mysql_function_query(gConnectionhandle, "SELECT DISTINCT `PlayerName` FROM `lol_Players` ORDER BY `Time` DESC LIMIT 10", true, "iLast10Logins", "s", channel);
    }
    return 1;
}

forward iLast10Logins(channel[]);
public iLast10Logins(channel[])
{
    new rows, fields, time[20], user[24], string[60];
    cache_get_data(rows, fields);
    IRC_GroupSay(gGroupID, channel, "________ Last 10 Logins ________");
    for(new i=0; i<rows; i++)
    {
        cache_get_field_content(i, "PlayerName", user);
        cache_get_field_content(i, "Time", time);
        format(string, sizeof(string), "%s logged in %s", user, time);
        IRC_GroupSay(gGroupID, channel, string);
    }
    return 1;
}
Reply


Messages In This Thread
MYSQL problem - by Richie© - 10.06.2013, 20:08
Re: MYSQL problem - by SuperViper - 10.06.2013, 20:26
Re: MYSQL problem - by Richie© - 10.06.2013, 20:42
Re: MYSQL problem - by Richie© - 11.06.2013, 20:24
Re: MYSQL problem - by Richie© - 12.06.2013, 12:43
Re: MYSQL problem - by Vince - 12.06.2013, 13:17
Re: MYSQL problem - by Richie© - 12.06.2013, 14:47

Forum Jump:


Users browsing this thread: 1 Guest(s)