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

Title: Help with table from phpdenora database.
Post 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.
Title: Re: Help with table from phpdenora database.
Post by: Hal9000 on May 09, 2012, 08:06:20 AM
I didn't understand a word, but i suppose you mean the ison table
Title: Re: Help with table from phpdenora database.
Post by: DavY on May 09, 2012, 12:30:43 PM
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.
Title: Re: Help with table from phpdenora database.
Post by: Jobe on May 09, 2012, 01:15:44 PM
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:
Code: [Select]
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:
Code: [Select]
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;
Title: Re: Help with table from phpdenora database.
Post by: DavY on May 10, 2012, 09:30:49 AM
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:
Code: [Select]
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:
Code: [Select]
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.