mysql - How do I merge messages using either OR or JOIN? -


i want show conversation between person , person b only.

type in facebook messages ...

the problem query returning messages , not ones between selected people.

how fix or or join?

select  *     msgs    usr_to = 'myself' ,     author_msg = 'he'  or      author_msg = 'myself'  ,     usr_to = 'he'  order id desc  limit 12 

use brackets group conditions:

$mysql = mysql_query(     "select *      msgs              (usr_to = 'myself' , author_msg = 'he')         or         (author_msg = 'myself' , usr_to = 'he')      order id desc      limit 12",     $mysql ); 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -