Anope IRC Services

MagIRC => MagIRC Support => Topic started by: luc on January 08, 2014, 01:33:54 PM

Title: sql query question
Post by: luc on January 08, 2014, 01:33:54 PM
Hello,

can please someone give me an example to make an sql query to output for example all users in a channel? lets say #test

Thanks
Title: Re: sql query question
Post by: CrazyCat on January 09, 2014, 07:49:09 AM
Code: [Select]
SELECT u.nick, u.realname, u.connecttime, u.away, u.awaymsg, i.mode_lh, i.mode_lo, i.mode_lv FROM (user u LEFT JOIN (ison i LEFT JOIN chan c ON i.chanid=c.chanid) ON u.nickid=i.nickid) WHERE channel='#test' ORDER BY i.mode_lo ASC, i.mode_lh ASC, i.mode_lv ASC, u.connecttime ASCGives you complete informations about users on a channel. I use it on http://www.zeolia.net/canaux/zeolia.html.

You can also use the rest API
Title: Re: sql query question
Post by: luc on January 09, 2014, 06:12:35 PM
thanks crazycat


can you tell me as well the sql for the 'toptalkers' in all the network i c'ant find it in the api
Title: Re: sql query question
Post by: CrazyCat on January 10, 2014, 03:53:09 PM
it's users/top/10