I have been able to offer a online database to a property management company where they can list properties on a very simple database INCLUDING PHOTOS that they can update themselves.
So I have created the database and placed the content management in a subdomain and everything seems to be working fine: EXCEPT that some (not all) of the photos do not display on the "View Properties" page. The photos that don't display seem to do so randomly. Furthermore, if you right-click on where the photos are supposed to be and select "Show Photo," the photo will then display.
Below is the link to the properties page as well as an explanation of the code I used to get there. I'm VERY new to PHP development and in need of help.
http://www.recaproperties.com/prop_all.php
RELEVANT LINE OF CODE ON PROP_ALL.PHP:
<td colspan=2 align="left" valign="middle" class="dataPhoto"></br><img src="photo_engine.php?propID='.htmlspecialchars(stripslashes($row[0])).'"></td>
RELEVANT CODE ON PHOTO_ENGINE.PHP:
<?
header("Content-type: image/gif");
$propID = $_GET['propID'];
@ $dbh = mysql_connect('localhost', 'recaprop_webUser', 'PASSWORD');
mysql_select_db ('recaprop_recadb1');
$sql = 'SELECT photo FROM properties WHERE propID = '.$propID.' AND LENGTH(photo) > 0';
$result = mysql_query($sql);
$nrows = mysql_num_rows($result);
if ($nrows < 1)
{
// this next line selects where I've stored the "no photo" image
$sqlb = "SELECT photo FROM properties WHERE propID = 0000001";
$resultb = mysql_query($sqlb);
$nrowsb = mysql_num_rows($resultb);
$rowb = mysql_fetch_array($resultb);
echo $rowb['photo'];
}
else
{
$row = mysql_fetch_array($result);
echo $row['photo'];
echo $filesize;
}
?>
WHAT I SUSPECT THE PROBLEM TO BE:
improper folder permissions - I occasionally get a 403 error. If so how do I change folder permissions on a virtual host?
although the BLOBs are all under their approriate size requirements, maybe I need to change the column type to Large BLOB?
Anyway, if anyone could offer help, I would most appreciative.