Forum Moderators: open
i want a list of companies that are present in company table but no in connectors.
table company
company_name
table connectors
company_name
connector_name
I need results that list companies that do not appear at all in connectors either the company_name or connector_name columns.
I have no idea how to do this and display the results, typical format i use is
$restofcompanylist=mysql_query("SELECT*FROM company LEFT JOIN connectors ON company.company_name=connectors.company_name WHERE (connectors.company_name) IS NULL");
the use a while loop to display results
while($restcompanyresults=mysql_fetch_array($restofcompanylist)){
echo"".$restcompanyresults['connectors.company_name']
}
Im stuck as my query above shows me nothing and its also only checking is the company name is in the company name column, it may only be in the connector_name column in which case the company is in the table and shouldnt be displays in my results, can anyone please help?
("SELECT*FROM company LEFT JOIN connectors ON company.company_name=connectors.company_name WHERE (connectors.company_name) IS NULL");
The part I have marked bold is saying that the name has to be NULL, which means has no value.
Take that out and try it...
("SELECT*FROM company LEFT JOIN connectors ON company.company_name=connectors.company_name");