Question

Only show certain images from MySQL database -PHP

Asked by: BrighteyesDesign

I have setup a real estate website here http://www.raglaninternational.com/index.php

My problem is with the property details page where i need to show images of each property.

I have a MySQL database setup with 10 image fields (which hold the url path for the image).

On the web page I have added 10 php queries to show the images, if there is not a url in one of the database fields (ie if there are only 9 images) an incorrect url path is sent to the page and the image does not show. However on IE these missing images show as a red cross.

What i need to do is set the images up so that if there is no url path an image does not show.

I hope that makes sense. I have attached the code for the property detail page.

<?php require_once('Connections/Raglan.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
$displayarray = array(
"F"=>"Asking price of",
"I"=>"Offers in the region of",
"O"=>"Offers in excess of",
"A"=>"Auction guide price of",
"S"=>"Subject to contract",
"R"=>"Price range of",
"B"=>"Prices from",
"G"=>"Guide price",
"P"=>"Price on application",
"W"=>"Weekly rental of",
"M"=>"Monthly rental of",
"N"=>"Annual rental of",
 
);
$colname_Recordset1 = "-1";
if (isset($_GET['id'])) {
  $colname_Recordset1 = $_GET['id'];
}
mysql_select_db($database_Raglan, $Raglan);
$query_Recordset1 = sprintf("SELECT propertyID, additionalimage1, additionalimage2, additionalimage3, additionalimage4, additionalimage5, additionalimage6, additionalimage7, additionalimage8, additionalimage9, additionalimage10, additionalkeywords, address, agentBranch, agentGroup, bathrooms, bedrooms, brochure, contactEmail, contactName, contactTelephone, countryCode, createdDate, details, EERCurrent, EERImage, EERPotential, EIRCurrent, EIRImage, EIRPotential, epcbutton, EPCDocument, exportDate, floorPlan1, floorPlan2, floorPlan3, floorplan4, fullPostCode, furnished, groundRent, HIPDocument, leaseholdYearsRemaining, mainimage, `mode`, modifiedDate, name, newHome, notes, FORMAT(prices,2) as prices, priceCurrency, pricePrefix, propertyType, receptionRooms, regionCode, rentalLength, saleOrRent, sellingState, serviceCharge, sharedCommision, summary, tenure, vTourURL, vTour2URL, fullPath, planbutton, google, area, FORMAT(prices2,2) as prices2, pricePrefix2, `currency` FROM properties WHERE propertyID = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $Raglan) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Raglan | Sales | Lettings | Property Management | International</title>
<link href="raglan.css" rel="stylesheet" type="text/css" />
 
<SCRIPT LANGUAGE="JavaScript">
 
img1 = new Image();
img1.src = "images/large/<?php echo$row_Recordset1['additionalimage1']; ?>";
 
img2 = new Image();
img2.src = "images/large/<?php echo$row_Recordset1['additionalimage2']; ?>";
 
img3 = new Image();
img3.src = "images/large/<?php echo$row_Recordset1['additionalimage1']; ?>";
 
img4 = new Image();
img4.src = "images/large/<?php echo$row_Recordset1['additionalimage2']; ?>";
 
img5 = new Image();
img5.src = "images/large/<?php echo$row_Recordset1['additionalimage1']; ?>";
 
img6 = new Image();
img6.src = "images/large/<?php echo$row_Recordset1['additionalimage2']; ?>";
 
img7 = new Image();
img7.src = "images/large/<?php echo$row_Recordset1['additionalimage1']; ?>";
 
img8 = new Image();
img8.src = "images/large/<?php echo$row_Recordset1['additionalimage2']; ?>";
 
</script>
 
<script type="text/javascript">
 
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function openChromeslessWindow(openUrl, winName, wWidth, wHeight, wPosx, wPosy, wTIT,
												windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel,
													bCenter, sFontFamily, sFontSize, sFontColor){
	
	openchromeless(openUrl,winName, wWidth, wHeight, wPosx, wPosy, wTIT, wTIT ,
							windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel,
								bCenter, sFontFamily, sFontSize, sFontColor);
}
//-->
</script>
 
 
 
</head>
 
<body onload="MM_preloadImages('images/but-sales-ovr.jpg','images/but-lettings-ovr.jpg','images/but-commercial-ovr.jpg','images/but-int-ovr.jpg','images/but-prop-ovr.jpg','images/but-news-ovr.jpg','images/but-cont-ovr.jpg','images/but-news.jpg','images/large/<?php echo$row_Recordset1['additionalimage2']; ?>','images/large/<?php echo$row_Recordset1['additionalimage4']; ?>','images/large/<?php echo$row_Recordset1['additionalimage5']; ?>','images/large/<?php echo$row_Recordset1['additionalimage11']; ?>','images/large/<?php echo$row_Recordset1['additionalimage1']; ?>')">
<table height="245" border="0" align="center" cellpadding="0" cellspacing="0" class="main">
  <tr>
    <td valign="top"><table width="400" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="55" align="left"><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','images/but-home-ovr.jpg',0)"><img src="images/but-home.jpg" alt="Raglan Home" name="Image1" width="55" height="37" border="0" id="Image1" /></a></td>
        <td width="51" align="left"><a href="sales.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','images/but-sales-ovr.jpg',1)"><img src="images/but-sales.jpg" alt="Raglan Property Sales" name="Image2" width="51" height="37" border="0" id="Image2" /></a></td>
        <td width="71" align="left"><a href="letting.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','images/but-lettings-ovr.jpg',1)"><img src="images/but-lettings.jpg" alt="Raglan lettings" name="Image3" width="71" height="37" border="0" id="Image3" /></a></td>
        <td width="43" align="left"><a href="commercial.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','images/but-commercial-ovr.jpg',1)"><img src="images/but-commercial.jpg" alt="Raglan Commercial Property" name="Image4" width="92" height="37" border="0" id="Image4" /></a></td>
        <td width="33" align="left"><a href="international.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','images/but-int-ovr.jpg',1)"><img src="images/but-int.jpg" alt="Raglan International Property" name="Image5" width="111" height="37" border="0" id="Image5" /></a></td>
        <td width="33" align="left"><a href="property.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','images/but-prop-ovr.jpg',1)"><img src="images/but-prop.jpg" alt="Raglan Property Management" name="Image6" width="170" height="37" border="0" id="Image6" /></a></td>
        <td width="33" align="left"><a href="news.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','images/but-news-ovr.jpg',1)"><img src="images/but-news.jpg" alt="Raglan Property News" name="Image7" width="115" height="37" border="0" id="Image7" /></a></td>
        <td width="33" align="left"><a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image8','','images/but-cont-ovr.jpg',1)"><img src="images/but-cont.jpg" alt="Contact Raglan Property" name="Image8" width="88" height="37" border="0" id="Image8" /></a></td>
        <td width="48"><img src="images/tel.jpg" width="227" height="37" alt="Raglan Property Telephone" /></td>
      </tr>
    </table>
      <table width="980" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="756" rowspan="2" valign="top" bgcolor="#FFFFFF"><table width="745" border="0" cellspacing="0" cellpadding="18">
            <tr>
              <td><span class="copyblueCopy"><img src="images/Rag-final.jpg" width="180" height="124" alt="property lettings" /><br />
                <img src="images/propertydetails.jpg" width="180" height="31" alt="property lettings" /></span></td>
            </tr>
            <tr>
              <td valign="top"><table width="714" border="0" cellpadding="0" cellspacing="0" class="detailbox">
                <tr>
                  <td width="300" rowspan="2" valign="top"><table width="279" border="0" cellspacing="0" cellpadding="10">
                    <tr>
                      <td width="259" valign="top" class="copy"><p><span class="blacktitle"><br />
                        <?php echo $row_Recordset1['name']; ?></span><br />
                        <br />
                        <span class="copyblue"><?php echo $displayarray[$row_Recordset1['pricePrefix']]; ?> </span><span class="copyblueCopy">£<?php echo $row_Recordset1['prices']; ?></span> <br />
                        <span class="copyblue"><?php echo $displayarray[$row_Recordset1['pricePrefix2']]; ?></span> <span class="copyblueCopy"><?php echo $row_Recordset1['currency']; ?><?php echo $row_Recordset1['prices2']; ?></span></span>                          <br />
                          <br />
                          <span class="copybold">Address</span><br />
                          <?php echo $row_Recordset1['address']; ?><br />
                          <br />
                          <span class="copybold">Property Details</span><br />
                          <?php echo nl2br($row_Recordset1['details']); ?><br />
                          <br />
                          <a href="http://www.raglaninternational.com/images/large/<?php echo nl2br($row_Recordset1['floorPlan1']); ?>"><img src="images/<?php echo nl2br($row_Recordset1['planbutton']); ?>" alt="" border="0" /></a><br />
                          <a href="http://www.raglaninternational.com/images/large/<?php echo nl2br($row_Recordset1['EPCDocument']); ?>"><img src="images/<?php echo nl2br($row_Recordset1['epcbutton']); ?>" alt="" border="0" /></a><br />
                          <span class="copybold">Please contact us for more details</span><br />
                          If you would like more information regarding this property please call us on +44 (0)20 3355 9321 or <a href="mailto:info@raglaninternational.com?subject=<?php echo$row_Recordset1['name']; ?>">email us</a><br />
                        </p></td>
                      </tr>
                    </table></td>
                  <td width="410" height="105" align="right" valign="top" bgcolor="#FFFFFF"><table width="400" border="0" cellpadding="0" cellspacing="0" class="hello">
                    <tr>
                      <td align="center" valign="top" bgcolor="#FFFFFF"><img src="images/large/<?php echo$row_Recordset1['mainimage']; ?>" name="main" width="" height="" class="gapbelow" id="main" /></td>
                      </tr>
                    <tr>
                      <td align="center" bgcolor="#FFFFFF"><img src="images/small/<?php echo$row_Recordset1['mainimage']; ?>" alt="" name="img1" class="thumbgapright" id="img13" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['mainimage']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage1']; ?>" name="img1" class="thumbgapright" id="img1" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage1']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage2']; ?>" alt="" name="img2" class="thumbgapright" id="img2" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage2']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage3']; ?>" alt="" name="img2" class="thumbgapright" id="img3" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage3']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage4']; ?>" alt="" name="img2" class="thumbgapright" id="img4" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage4']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage5']; ?>" alt="" name="img2" class="thumbgapright" id="img5" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage5']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage6']; ?>" alt="" name="img2" class="thumbgapright" id="img6" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage6']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage7']; ?>" alt="" name="img2" class="thumbgapright" id="img7" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage7']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage8']; ?>" alt="" name="img2" class="thumbgapright" id="img8" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage8']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage9']; ?>" alt="" name="img2" class="thumbgapright" id="img9" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage9']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage10']; ?>" alt="" name="img2" class="thumbgapright" id="img10" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage10']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage11']; ?>" alt="" name="img2" class="thumbgapright" id="img11" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage11']; ?>',1)" /><img src="images/small/<?php echo$row_Recordset1['additionalimage12']; ?>" alt="" name="img2" class="thumbgapright" id="img12" onclick="MM_swapImage('main','','images/large/<?php echo$row_Recordset1['additionalimage12']; ?>',1)" /></td>
                      </tr>
                    </table></td>
                  </tr>
                <tr>
                  <td align="right" valign="top"><table width="400" border="0" cellpadding="0" cellspacing="0" class="topgap">
                    <tr>
                      <td><?php echo$row_Recordset1['google']; ?></td>
                    </tr>
                  </table></td>
                  </tr>
                </table></td>
            </tr>
          </table></td>
          <td width="224" align="right" valign="top" bgcolor="#FFFFFF"><table width="222" border="0" cellpadding="0" cellspacing="0" class="search">
            <tr>
              <td height="30">&nbsp;</td>
            </tr>
            <tr>
              <td height="271" align="center" valign="top"><table width="216" border="0" cellpadding="10" cellspacing="0">
                <tr>
                  <td valign="top"><form id="form1" name="form1" action="SearchResults.php" method="get">
                    <table width="200" border="0" cellpadding="8" cellspacing="1">
                      <tr>
                        <td bgcolor="#F6F6F6"><span class="copybold">I want to:</span><br />
                          <table width="175" height="18" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td width="58" valign="top"><input name="type" type="radio" class="radiogap" id="saleOrRent" value="Sales" checked="checked" />
                                <span class="copy">Buy </span><br />
                                <select name="min2" class="copy" id="min2">
                                  <option value="0">£ buy minimum</option>
                                  <option value="75000">75,000</option>
                                  <option value="100000">100,000</option>
                                  <option value="150000">150,000</option>
                                  <option value="200000">200,000</option>
                                  <option value="400000">400,000</option>
                                  <option value="500000">500,000</option>
                                  <option value="600000">600,000</option>
                                  <option value="700000">700,000</option>
                                  <option value="800000">800,000</option>
                                  <option value="900000">900,000</option>
                                  <option value="1000000">1,000,000</option>
                                  <option value="1250000">1,250,000</option>
                                  <option value="1500000">1,500,000</option>
                                  <option value="2000000">2,000,000</option>
                                  <option value="3000000">3,000,000</option>
                                </select>
                                <select name="max2" class="copy" id="max2">
                                  <option value="1000000000">£ buy maximum</option>
                                  <option value="75000">75,000</option>
                                  <option value="100000">100,000</option>
                                  <option value="150000">150,000</option>
                                  <option value="200000">200,000</option>
                                  <option value="400000">400,000</option>
                                  <option value="500000">500,000</option>
                                  <option value="600000">600,000</option>
                                  <option value="700000">700,000</option>
                                  <option value="800000">800,000</option>
                                  <option value="900000">900,000</option>
                                  <option value="1000000">1,000,000</option>
                                  <option value="1250000">1,250,000</option>
                                  <option value="1500000">1,500,000</option>
                                  <option value="2000000">2,000,000</option>
                                  <option value="3000000">3,000,000</option>
                                </select></td>
                            </tr>
                          </table></td>
                      </tr>
                      <tr>
                        <td bgcolor="#F6F6F6"><table width="174" height="18" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="58" valign="top"><span class="copy">
                              <input name="type" type="radio" class="radiogap" id="saleOrRent2" value="rent" />
                              Rent <br />
                              <select name="min" class="copy" id="min">
                                <option value="0">£ rental minimum</option>
                                <option value="100">£100 per week</option>
                                <option value="250">£250 per week</option>
                                <option value="400">£400 per week</option>
                                <option value="500">£500 per week</option>
                                <option value="600">£600 per week</option>
                                <option value="750">£750 per week</option>
                                <option value="1000">£1000 per week</option>
                                <option value="1500">£1500 per week</option>
                                <option value="2000">£2000 per week</option>
                              </select>
                              <select name="max" class="copy" id="max">
                                <option value="100000000">£ rental maximum</option>
                                <option value="100">£100 per week</option>
                                <option value="250">£250 per week</option>
                                <option value="400">£400 per week</option>
                                <option value="500">£500 per week</option>
                                <option value="600">£600 per week</option>
                                <option value="750">£750 per week</option>
                                <option value="1000">£1000 per week</option>
                                <option value="1500">£1500 per week</option>
                                <option value="2000">£2000 per week</option>
                              </select>
                            </span></td>
                          </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td bgcolor="#F6F6F6"><span class="copybold">Bedrooms:</span>
                          <select name="bedrooms" class="copy" id="bedrooms">
                            <option value="1" selected="selected">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                            <option value="6+">6+</option>
                          </select></td>
                      </tr>
                      <tr>
                        <td bgcolor="#F6F6F6"><span class="copybold">Area:</span>
                          <select name="area" class="copy" id="area">
                            <option value="London">Premium London</option>
                            <option value="Country">Country</option>
                            <option value="International">International</option>
                          </select></td>
                      </tr>
                      <tr>
                        <td><input name="submit" type="image" id="submit" src="images/search.jpg" alt="Add to Basket" /></td>
                      </tr>
                    </table>
                  </form></td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td align="right" valign="top" bgcolor="#FFFFFF"><table width="222" border="0" cellpadding="0" cellspacing="0" class="piclink">
            <tr>
              <td valign="top"><table width="222" border="0" cellpadding="10" cellspacing="0" class="logos">
                <tr>
                  <td align="center"><span class="copy"><img src="images/facebook-logo.jpg" width="160" height="94" alt="DPS logo" /></span></td>
                  </tr>
                <tr>
                  <td align="center"><span class="copy"><img src="images/twitter-logo.jpg" width="160" height="66" alt="DPS logo" /></span></td>
                  </tr>
                <tr>
                  <td><span class="copy"><img src="images/find_a_property.gif" width="196" height="80" alt="DPS logo" /></span></td>
                  </tr>
                <tr>
                  <td align="center"><span class="copy"><img src="images/primelocation-logo.gif" width="95" height="95" alt="DPS logo" /></span></td>
                  </tr>
                <tr>
                  <td align="center"><span class="copy"><img src="images/dps-logo.jpg" width="100" height="54" alt="DPS logo" /></span></td>
                  </tr>
                </table></td>
              </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td valign="top"><table width="150" border="0" cellpadding="0" cellspacing="0" class="bottombit">
      <tr>
        <td align="center" class="terms" onclick="openChromeslessWindow('terms.html','Terms',800,600,null,null,'Terms', '#000000', '#000000', '#999988', '#808040' ,true,'Verdana, Geneva, sans-serif', '1','#000000')">© Raglan International 2009 |<a href="terms.html" class="web"> terms &amp; conditions</a> | <span class="web"><a href="privacy.html" class="web">Privacy Policy</a></span> |<a href="http://www.brighteyesdesign.co.uk" class="web"> website by brighteyes</a></td>
      </tr>
    </table>      <a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image8','','images/but-cont-ovr.jpg',1)"></a></td>
  </tr>
</table>
 
 
</body>
</html>
 
<?php
mysql_free_result($Recordset1);
?>

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-10-27 at 01:53:29ID24846449
Topics

MySQL Server

,

PHP Scripting Language

Participating Experts
2
Points
500
Comments
4

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Php and mysql
    I have a mysql database that lists 5 thousand businesses and i have wrote a php page that will pull back the first 5 listings and tell the person how many are relative to there seach. So all businesses in essex will show the first 5 and say there are a total of 88. how do i...
  2. mySQL and php
    Hi, Is there a mySQL and php bible out there? There are a lot of books listed on amazon.com, and I was wondering if there's one you experts would recommend. Also, what's the best on-line resource for learning about this from A to Z? Thanks, f
  3. paging in php+mysql
    Hi Experts, After get the result from Select * From....., want to display from 1 to 20 records only and in the next web page display from 21 to 40 records...... Can you show me the code how to do this in php+mysql?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: chilternPCPosted on 2009-10-27 at 02:01:45ID: 25670279

the easiest way would be to have a "default imsge"  saying somethign like "image not yet available" or "awaiting images"  and set all image urls to this default and only point the image url to an actual photo when there is one.
the lack of an image will be hanlded diffefrnelty in browser so its best to havea default place holder then at least it all lays out correctly.

 

by: theGhost_k8Posted on 2009-10-27 at 02:04:50ID: 25670301

- I suggest you better make a saperate table for storing images with prop.id as FK.
- You may also have a default image eg. Image Not Available
  Query>> SELECT propertyID, ifnull(additionalimage1,'default-image-path'), ifnull(additionalimage2,'default-image-path') ....

- Even the same you can handle in your code while echoing image you may check it for value.

 

by: theGhost_k8Posted on 2009-10-27 at 02:06:42ID: 25670322

@chilternPC: Page refreshed and I don't believe what I read !!
:)

 

by: chilternPCPosted on 2009-10-27 at 03:17:27ID: 25670693

:-)) great minds and all that...

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...