Anope IRC Services
Denora Stats (discontinued) => Denora 1.5.x Support (Read Only) => Topic started by: DavY on May 09, 2012, 12:28:44 AM
-
Hello everybody,
I have a question. I have some time trying to figure out from the table and get kolumn reached in which channel a user is. I would like to know how database is selected in which channel a user is. If anyone can help me here, Thank you very much! Sorry for my bad english.. I'm from the netherlands.
Best regards.
-
I didn't understand a word, but i suppose you mean the ison table
-
I didn't understand a word, but i suppose you mean the ison table
Sorry for my confusion. I will try to explain better in english. I am currently working on its own php to write, so I put it on a profile page of a member may indicate in which channel it is online, but I just do not know what table and kolumn of DeNora database that is. It would be easier if I knew. this is so because I want to know which database DeNora cites in which channel a user is online. I hope this is somewhat clearer and you can help me with this.
-
To get a list of channels a user is on, whether the channel has +p or +s, and what that users status is on each channel using their nick you would use this query:
SELECT chan.channel, chan.mode_lp, chan.mode_ls, ison.* FROM chan, ison, user WHERE ison.chanid = chan.chanid AND ison.nickid = user.nickid AND user.nick = '<nick>' ORDER BY chan.channel;
If you know the nickid (eg you have already retrieved it) you can shorten that to:
SELECT chan.channel, chan.mode_lp, chan.mode_ls, ison.* FROM chan, ison WHERE ison.chanid = chan.chanid AND ison.nickid = <nickid> ORDER BY chan.channel;
-
To get a list of channels a user is on, whether the channel has +p or +s, and what that users status is on each channel using their nick you would use this query:
SELECT chan.channel, chan.mode_lp, chan.mode_ls, ison.* FROM chan, ison, user WHERE ison.chanid = chan.chanid AND ison.nickid = user.nickid AND user.nick = '<nick>' ORDER BY chan.channel;
If you know the nickid (eg you have already retrieved it) you can shorten that to:
SELECT chan.channel, chan.mode_lp, chan.mode_ls, ison.* FROM chan, ison WHERE ison.chanid = chan.chanid AND ison.nickid = <nickid> ORDER BY chan.channel;
Perfect! Thanks for your help Jobe.. That was what i wanted.