Is Mysql IF EXIST what should be used for this query? -
select social_members.* , social_mcouple.* m_id = '".$_session['userid'] . "' , c_id = '".$_session['userid'] . "' select fields social_members.* , if social_mcouple.c_id = $_session['userid'] select fields social_mcouple.* well. can done if exist , if how. thanks if undertand correctly, outer join better here. select social_members.* , social_mcouple.* social_members left outer join social_mcouple on social_members.m_id=social_mcouple.c_id m_id='".$_session['userid']."' this retrieve rows each member, , corresponding rows social_mcouple . if there no corresponding rows in social_mcouple table, social_mcouple.* rows in result null. depending upon exact needs, , relationship between 2 tables, may better running 2 queries, 1 retrieve matching rows social_members, , other retrieve rows social_mcouple. whether take outer join or 2 separate queries depend...