Right I have a problem and the standard way of resolving it does not appear to work in this instance so I need a way to solve it.
I have a MySQL database with table called properties in - This works fine now each row in my database has an image attched which is the picture of a property
I can return all the text and numeric data fine - no problem there at all
The picture is correctly store as a BLOB in the database
As has been suggested i'e changed the content type to be image/jpeg
this is currently commented out as it does not work
I've attached my files here
THIS IS THE RESULTS FILE....
<!DOCTYPE HTML PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #FFFFFF;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.style9 {font-size: 14px}
.style21 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.style22 {
font-family: Arial, Helvetica, sans-serif;
color: #000000;
font-weight: bold;
font-size: larger;
}
.style24 {
font-size: x-small;
font-family: Tahoma;
}
.style25 {color: #000000; font-family: Arial, Helvetica, sans-serif;}
-->
</style>
</head>
<body>
<table width="285" height="341" border="0" align="center" cellspacing="2">
<tr>
<td height="22" align="center" valign="top" bgcolor="#FFCC00" class="style22"><span class="style21">Agents Name & Logo Here</span></strong>
</div>
</tr>
<tr>
<td height="38" bgcolor="#FFCC00" class="style9"><div align="center" class="style25">Mobile Property Search Results Page</div>
</tr>
<tr>
<td height="246" bgcolor="#0000FF" class="style9">
<?php
// Turn Off All Error Reporting
error_reporting(1);
//Connect To Database
$conn = mysql_connect("localhost","web233-smt-web_1","john041066") OR die ("Connection Error: ".mysql_error());
if(!$conn)
{
echo mysql_error();
}
$db = mysql_select_db("web233-smt-web_1",$conn) OR die ("DB Error: ".mysql_error());
if(!$db)
{
echo mysql_error();
}
//Get Values Sent Over Search Form
$saleorrent = $_GET['prop_sr'];
$propertytype = $_GET['prop_type'];
$bedrooms = $_GET['prop_bed'];
$minimum = $_GET['min_price'];
$maximum = $_GET['max_price'];
//Build The Query - This Works Just fine providing you are using the MySQL fetch array method !!!
$query = "SELECT * FROM properties
WHERE prop_sr = '$saleorrent'
AND prop_type = '$propertytype'
AND prop_bed = '$bedrooms'
AND prop_price >= '$minimum'
AND prop_price <= '$maximum'";
$result = mysql_query($query) or die(mysql_error());
//header("Content-type: image/jpeg");
while($row = mysql_fetch_array($result)){
//echo $row['prop_photo']; echo $row['prop_sr'];
echo $row['prop_type'];
echo $row['prop_bed'];
echo $row['prop_addr'];
echo $row['prop_price'];
}
?>
</tr>
<tr>
<td height="21" align="center" valign="top" bgcolor="#FFCC33"><span class="style24">By Computer Solutions © 2012</span><span class="style24"></span><span class="style9"><br />
</span></td>
</tr>
<td height="2">
</table>
</body>
</html>
I have a MySQL database with table called properties in - This works fine now each row in my database has an image attched which is the picture of a property
I can return all the text and numeric data fine - no problem there at all
The picture is correctly store as a BLOB in the database
As has been suggested i'e changed the content type to be image/jpeg
this is currently commented out as it does not work
I've attached my files here
THIS IS THE RESULTS FILE....
<!DOCTYPE HTML PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #FFFFFF;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.style9 {font-size: 14px}
.style21 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.style22 {
font-family: Arial, Helvetica, sans-serif;
color: #000000;
font-weight: bold;
font-size: larger;
}
.style24 {
font-size: x-small;
font-family: Tahoma;
}
.style25 {color: #000000; font-family: Arial, Helvetica, sans-serif;}
-->
</style>
</head>
<body>
<table width="285" height="341" border="0" align="center" cellspacing="2">
<tr>
<td height="22" align="center" valign="top" bgcolor="#FFCC00" class="style22"><span class="style21">Agents Name & Logo Here</span></strong>
</div>
</tr>
<tr>
<td height="38" bgcolor="#FFCC00" class="style9"><div align="center" class="style25">Mobile Property Search Results Page</div>
</tr>
<tr>
<td height="246" bgcolor="#0000FF" class="style9">
<?php
// Turn Off All Error Reporting
error_reporting(1);
//Connect To Database
$conn = mysql_connect("localhost","web233-smt-web_1","john041066") OR die ("Connection Error: ".mysql_error());
if(!$conn)
{
echo mysql_error();
}
$db = mysql_select_db("web233-smt-web_1",$conn) OR die ("DB Error: ".mysql_error());
if(!$db)
{
echo mysql_error();
}
//Get Values Sent Over Search Form
$saleorrent = $_GET['prop_sr'];
$propertytype = $_GET['prop_type'];
$bedrooms = $_GET['prop_bed'];
$minimum = $_GET['min_price'];
$maximum = $_GET['max_price'];
//Build The Query - This Works Just fine providing you are using the MySQL fetch array method !!!
$query = "SELECT * FROM properties
WHERE prop_sr = '$saleorrent'
AND prop_type = '$propertytype'
AND prop_bed = '$bedrooms'
AND prop_price >= '$minimum'
AND prop_price <= '$maximum'";
$result = mysql_query($query) or die(mysql_error());
//header("Content-type: image/jpeg");
while($row = mysql_fetch_array($result)){
//echo $row['prop_photo']; echo $row['prop_sr'];
echo $row['prop_type'];
echo $row['prop_bed'];
echo $row['prop_addr'];
echo $row['prop_price'];
}
?>
</tr>
<tr>
<td height="21" align="center" valign="top" bgcolor="#FFCC33"><span class="style24">By Computer Solutions © 2012</span><span class="style24"></span><span class="style9"><br />
</span></td>
</tr>
<td height="2">
</table>
</body>
</html>