INNER JOIN


#1

Why is this not working?
[php]<?php
include(‘inc/connect.php’);
$query = “SELECT mrk.state, mrk.company, mrk.address1, mrk.postal, mrk.city, mrk.latitude, mrk.longitude, zipdata.zip
FROM mrk
INNER JOIN zipdata
ON mrk.postal=zipdata.zip”;
$result = mysql_query ($query);
while ($row = mysql_fetch_assoc ($result)) {

echo $row['company'];

}
?>
[/php]


#2

change the query to
[php]$result = mysql_query ($query) or die(mysql_error());[/php]

That will instantly tell you if something is wrong with the query. could just be using the wrong type of join though.