Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Help with table from phpdenora database.  (Read 8534 times)

0 Members and 1 Guest are viewing this topic.

DavY

  • Anope User
  • Offline Offline
  • Posts: 11
Help with table from phpdenora database.
« 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.
Logged

Hal9000

  • Team
  • *
  • Offline Offline
  • Posts: 103
Re: Help with table from phpdenora database.
« Reply #1 on: May 09, 2012, 08:06:20 AM »

I didn't understand a word, but i suppose you mean the ison table
Logged

DavY

  • Anope User
  • Offline Offline
  • Posts: 11
Re: Help with table from phpdenora database.
« Reply #2 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.
Logged

Jobe

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1023
    • Anope IRC Services
Re: Help with table from phpdenora database.
« Reply #3 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;
Logged
Your IP: ()
My IRC Status:

Come along and visit http://www.anopequotes.org/

DavY

  • Anope User
  • Offline Offline
  • Posts: 11
Re: Help with table from phpdenora database.
« Reply #4 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.
Logged
Pages: [1]   Go Up