hi everyone, i am trying to compare 2 tables and return the difference, i can join the tables (no problem there), but can`t get the difference in the 2. to clarify my problem, table1 has company_id as does table2 but table 2 does not have ALL the company_id`s as table 1 has, now i am wanting to find out the company_id`s that do not match. this is what i am currently trying, i am not getting any errors, all i am getting is the company_id`s that DO match.
$query=mysql_query("SELECT * from company as c1
messages as c2
on c1.company_id=c2.company_id where c1.company_id != ''") or die (mysql_error());
when i use c1.company_id or the * i get either ALL the id`s from the company table or ALL the id`s that do match. this is using either the LEFT JOIN or RIGHT JOIN, doesnt matter which one i use. i have tried ever way using left and right join and nothing is giving the right results
when i tried that earlier it wouldnt give any results but just tried it again and now it works!! ty so much, now to figure out how to get the company_name to show up in a drop down. lol always something, eh?