I have two tables firm and contactdetails. I am trying to get the the firm name from firm and certain contact details from contactdetails. I am using $id =$_GET['id'];
to get the id . In contactdetails i have fk_firm_id which is my foreign key. I am not sure how to use the inner join query. I am trying the following query:
$sql="SELECT firm.`name` ,`address_physical_line_1` , `fax_1` , `phone_1`
FROM contactdetails JOIN firm ON contactdetails.fk_firm_id='$id'";
echo $sql;
$result = mysql_query($sql);
but i am not getting the correct firm. Can anyone help me with this query, please.
var
. You have to define table columns. Read Documentvar
. This would just be awhere