sorry for the delayed response. First of all, thank you for responding. I really appreciate the help. This has been something I have dreaded doing just out of my own noob fear of the unknown lol
I tried out both examples and read up on the manual and still feel pretty lost....
Ideally I am trying to make it so when someone opens up the page containing a record for a property/building pulling data off of the bldgs table, there will also be a link to anything for lease, opens that page and the data there pulls from the for_lease table. The 2 fields that are shared between the tables will be bldg_id.
Let me show you some of the example php I've tried using to do this, and maybe you can point out what I did wrong
require 'globals/dbconnect.php';
$query = "select * from bldgs, left join forlease on bldg_id = bldg_id ";
//then call the query and display it
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$numofrows = mysql_num_rows($result);
echo "<TABLE BORDER=\"0\">\n";
echo "<TR bgcolor=\"#E9F0F3\"><TD>Name</TD></TR>\n";
for($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_array($result); //get a row from our result set
if($i % 2) { //this means if there is a remainder
echo "<TR bgcolor=\"#F0F0F0\">\n";
} else { //if there isn't a remainder we will do the else
echo "<TR bgcolor=\"white\">\n";
}
echo '<TD>'.$row['bldgs.bldg_id'].'</TD>';
echo "</TR>\n";
}
//now let's close the table and be done with it
echo "</TABLE>\n";
The error i get with this is;
Query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join forlease on bldg_id = bldg_id' at line 1
Suggestions?