[thelist] Sql join problem

partyarmy partyarmy at gmail.com
Wed Dec 8 20:18:46 CST 2004

Not sure what i'm doing wrong with my join in mysql.

SELECT profile.member_id, members.member_id FROM members JOIN profile
WHERE members.username LIKE '%party%' OR members.email_address LIKE
'%party%' AND (profile.category_id = '1' AND profile.content = 'blah')
LIMIT 0, 12

so that statement should select the 'member_id' from either the
profile or members tables where the username or email_address columns
are LIKE %party% and where the 'category_id' and 'content' match up.
limit of 12 for display.

the problem is if there is less than 12 results i get the result set
repeated. is there not a way to select from two different tables and
merge the results in mysql. does someone have an easy tutorial that i
could follow. i tried the manual, but it's too confusing for me.

thanks, codi lechasseur

More information about the thelist mailing list