Page 1 of 1

Can anyone see whats wrong here?

Posted: Thu Jan 25, 2007 5:46 pm
by ianhull
I am having trouble with the media_image_00
It does not switch to the awaiting-image.jpg if it is empty,

Can anyoone see why?

Thanks

Code: Select all


<?php

include_once("includes/connection.php");

$getProperties = mysql_query("SELECT
property_id,
postcode1,
summary,
status_id,
bedrooms,
price,
price_qualifier,
create_date,
update_date,
display_address,
let_date_available,
let_bond,
let_type_id,
let_furn_id,
let_rent_frequency,
trans_type_id,
new_home_flag,
new_home_style,
new_home_site_profile,
media_image_00
FROM properties LIMIT 2")or die(mysql_error());

echo '<table width="100%%" border="0" cellspacing="3" cellpadding="3">';
while ($propertiesRecieved = mysql_fetch_array($getProperties)){
extract($propertiesRecieved);

//media_image_00
if ($media_image_00 == ""){
$media_image = "awaiting-image.jpg";
};

//trans_type_id
if ($trans_type_id == 1){
$trans_type_id = "For Sale";
//
    if ($new_home_flag == Y){
    $new_home_flag = "New";
    };
//
    if ($price_qualifier == 1){
    $price_qualifier = "POA";
    };
    if ($price_qualifier == 2){
    $price_qualifier = "Guide Price";
    };
    if ($price_qualifier == 3){
    $price_qualifier = "Fixed Price";
    };
    if ($price_qualifier == 4){
    $price_qualifier = "Offers Over";
    };
    if ($price_qualifier == 5){
    $price_qualifier = "OIRO";
    };
    if ($price_qualifier == 6){
    $price_qualifier = "Sale by Tender";
    };
    if ($price_qualifier == 7){
    $price_qualifier = "From";
    };
//
    echo '<tr>
    <td width="9%" rowspan="2" align="left" valign="top"><img src="property_images_tn/'.$media_image_00.'" alt="'.$summary.'" width="60" height="60"></td>
    <td colspan="2" align="left" valign="top">'.$trans_type_id.' '.$price.' '.$price_qualifier.' </td>
  </tr>
  <tr>
    <td width="58%" align="left" valign="top">'.$summary.'</td>
    <td width="33%" align="left" valign="top"><a href="#">Info</a></td>
  </tr>';
};

if ($trans_type_id == 2){
$trans_type_id = "To Let";
//
    if ($status_id == 0){
    $status_id = "Available";
    };
    if ($status_id == 1){
    $status_id = "ASSTC";
    };
    if ($status_id == 2){
    $status_id = "SSTCM (Scotland only)";
    };
    if ($status_id == 3){
    $status_id = "Under Offer";
    };
    if ($status_id == 4){
    $status_id = "Reserved";
    };
    if ($status_id == 5){
    $status_id = "Let Agreed";
    };
//
    if ($let_type_id == 0){
    $let_type_id = "Not Specified";
    };
    if ($let_type_id == 1){
    $let_type_id = "Long Term";
    };
    if ($let_type_id == 2){
    $let_type_id = "Short Term";
    };
    if ($let_type_id == 3){
    $let_type_id = "Student";
    };
    if ($let_type_id == 4){
    $let_type_id = "Commercial";
    };
//
    if ($let_furn_id == 0){
    $let_furn_id = "Furnished";
    };
    if ($let_furn_id == 1){
    $let_furn_id = "Part Furnished";
    };
    if ($let_furn_id == 2){
    $let_furn_id = "Un Furnished";
    };
    if ($let_furn_id == 3){
    $let_furn_id = "Not Specified";
    };
    if ($let_furn_id == 4){
    $let_furn_id = "Furnished / Part Furnished / Unfurnished";
    };
//
    if ($let_rent_frequency == "0"){
    $let_rent_frequency = "Weekly";
    };
    if ($let_rent_frequency == "1"){
    $let_rent_frequency = "Monthly";
    };
    if ($let_rent_frequency == "2"){
    $let_rent_frequency = "Quarterly";
    };
    if ($let_rent_frequency == "3"){
    $let_rent_frequency = "Annual";
    };
//
    echo '<tr>
    <td width="9%" rowspan="2" align="left" valign="top"><img src="property_images_tn/'.$media_image_00.'" alt="'.$summary.'" width="60" height="60"></td>
    <td colspan="2" align="left" valign="top">'.$trans_type_id.' '.$price.' '.$let_type_id .' </td>
  </tr>
  <tr>
    <td width="58%" align="left" valign="top">'.$summary.'</td>
    <td width="33%" align="left" valign="top"><a href="#">Info</a></td>
  </tr>';
};

}
echo '</table>';
?>


Posted: Thu Jan 25, 2007 5:51 pm
by feyd
Your code sets $media_image not $media_image_00.

Posted: Thu Jan 25, 2007 5:53 pm
by ianhull
Sorry guys,

a simple typo media_image

media_image_00

lol

Posted: Thu Jan 25, 2007 5:54 pm
by ianhull
Thanks feyd :D