My issue is this, if you enter the admin area and are adding say a commercial property, you may to use the fields "zone, taxes, fencing, rail, dock" if you then add a property to rental you need a different set of fields to fill in. Well when the display side runs, if they click on rental, I only want the fields with data in that record displayed, BUT I really didn't want to code my queries with those sets and make 6 different display pages. Make any sense?
This is my query, I am getting the ID set by the previous pages list of the property:
$colname_prop_result = "-1";
if (isset($_GET['prop_id'])) {
$colname_prop_result = (get_magic_quotes_gpc()) ? $_GET['prop_id'] : addslashes($_GET['prop_id']);
}
mysql_select_db($database_car_connect, $car_connect);
$query_prop_result = "SELECT * FROM properties WHERE prop_id = $colname_prop_result";
$prop_result = mysql_query($query_prop_result, $car_connect) or die(mysql_error());
$row_prop_result = mysql_fetch_assoc($prop_result);
$totalRows_prop_result = mysql_num_rows($prop_result);
This is the first IF block:
if ($row_prop_result['prop_status'] == '') {
echo "";
}
else {
echo "<tr><td>Property Status:</td><td>".$row_prop_result['prop_status']."</td></tr>";
}