Forum Moderators: open

Message Too Old, No Replies

MySQL query help

         

madk

8:41 pm on Jan 10, 2009 (gmt 0)

10+ Year Member



Hello all,

I'm pretty new to MySQL and am trying to work out a somewhat more advanced query. I have 2 tables:

userdata - username, pass, email etc
userpref - site settings

What I need to do is find all of the users who have the nofity settings set to 1 within userpref. For some reason I haven't been able to wrap my mind around how to query both tables.

Any assistance will be greatly appreciated. Thanks!

madk

8:47 pm on Jan 10, 2009 (gmt 0)

10+ Year Member



I think I got it:

SELECT userdata.username, userdata.user_email FROM userdata, userpref WHERE userprefs.user_id = userdata.user_id AND userpref.notify = '1'

txbakers

7:19 pm on Jan 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yep, that's the ticket.