Count bans in a MySQL system
#8

Quote:
Originally Posted by Sinner
Посмотреть сообщение
Код:
SELECT COUNT(*)
FROM `banlog`
WHERE `banned` = 1
GROUP BY name
Will return the number of users banned. If you can solve your problem in the query, as opposed to using more functions in pawn afterwards, do it.
Being a noob n' all and still just learning MySQL
I came up with this:
pawn Код:
stock bancount(playerid)
{
    new row[24];
    mysql_query( "SELECT COUNT(`name`) FROM `banlog` WHERE `banned` = '1' GROUP BY name" );
    mysql_store_result();
    mysql_free_result();
return 1;
}
Am I doing it wrong?
Reply


Messages In This Thread
Count bans in a MySQL system - by Neil. - 30.01.2013, 08:42
Re: Count bans in a MySQL system - by BlackRaven - 30.01.2013, 09:02
Re: Count bans in a MySQL system - by Neil. - 30.01.2013, 09:27
Re: Count bans in a MySQL system - by BlackRaven - 30.01.2013, 10:13
Re: Count bans in a MySQL system - by ikey07 - 30.01.2013, 10:25
Re: Count bans in a MySQL system - by Neil. - 30.01.2013, 10:40
Re: Count bans in a MySQL system - by Sinner - 30.01.2013, 11:01
Re: Count bans in a MySQL system - by Neil. - 30.01.2013, 11:17

Forum Jump:


Users browsing this thread: 1 Guest(s)