see my last posts http://stackoverflow.com/questions/3085796/help-me-in-mysql-query http://stackoverflow.com/questions/3079625/mysql-join-left-help
Can you please tell me how can i redesign the tables? I mean which things should be changed? Also, How about if i make 2 queries like: Query 1:
Select from Table one where column1 = 'smith' OR column2 = 'smith' AND status=1
then with help of PHP i get the value
if($result['column1']=='smith') {
$getValue = $result['column2'] }
else { $getValue = $result['column1'] }
Query2:
Select from Table2 where column1 = '$getvalue' OR column2 = '$getvalue'
Please tell me if this is good approach OR I should redesign the tables? IF I should redesign, can you please tell me what changes I should make in above table design.