I've got two tables relating to real estate-- Property Name & Suite
I have code that displays each of a Properties and its Suites together on one page, so that the operator can update all the various Properties Suite's prices or configuration changes.
Example:
Vista Building | Suite 25 | $25.85/sq ft | Window View
I want to have the Properties as a drop down table--but I am doing something wrong. I can get the drop down to work by itself, and I get the suite updates to work by itself. But if I put them together it looks like a car wreak. I'm still in the beginner phase and easily confused (at least that's my excuse). I've spent a day trying to figure this out...at this point, there's no hair left on the head. Here's the code. Help would be gratefully accepted.
$get_info="SELECT prop_id, prop_name
FROM office_avail_props
ORDER BY prop_name ";
$get_info_res=mysql_query($get_info, $link )or die(mysql_error($mysql));
$result = mysql_query("SELECT id_suite, prop_id, suite, sq_ft, rate, detail, notes, prop_name
FROM office_avail_suites
LEFT JOIN office_avail_props
USING(prop_id)
ORDER BY prop_name ASC, suite ASC
");
while ($units = mysql_fetch_array($result)) {
//display details in table
print "<input type='hidden' name='id_suite[$i]' value='{$units['id_suite']}' />";
print "<tr>
<td><select name=\"property_info\">";
while($row=mysql_fetch_array($get_info_res)){
print "<option value=\"".$row['prop_id']."\">" . $row['prop_name'] ;
echo "</option></select></td>";
print "
<td class =\"table_cell\" width = \"5\"><input type='text' size='5' name='suite[$i]' value='{$units['suite']}' />\n </td>
<td class =\"table_cell\" width = \"10\"><input type='text' size='5' name='sq_ft[$i]' value='{$units['sq_ft']}' />\n </td>
<td class =\"table_cell\" width = \"10\"><input type='text' size='5' name='rate[$i]' value='{$units['rate']}' />\n </td>
<td class =\"table_cell\" width = \"25\"><input type='text' size='45' name='detail[$i]' value='{$units['detail']}' />\n </td>
<td class =\"table_cell\" width = \"25\"><input type='text' size='45' name='notes[$i]' value='{$units['notes']}' />\n </td>
</p>\n </td></tr>";
};
// add 1 to the count, close the loop, close the form, and the mysql connection
++$i;
}