So I have the following code
$query=mysql_query("SELECT * FROM `phones` JOIN manufacturer USING (ManufacturerID) JOIN operatingsystem USING (OSID) WHERE PhoneID=$id");
$row=mysql_fetch_object($query);
echo mysql_error();
while($row=mysql_fetch_array($result))
{ ?>
<div class="phones">
<?php
echo "<img src=\"images/phones/".$row['LargeImg']."\"/>";
echo "<h2>";
echo "$row->Name $row->Model";
echo "</h2>";
echo "<p>";
echo "<ul>";
echo "<li>Running $row->OSName</li>";
echo "<br />";
echo "<li>$row->ScreenSize Display</li>";
echo "<br />";
echo "<li>$row->StorageSize of Storage</li>";
echo "</p>";
echo "</ul>";
?>
</div>
<?php
}
mysql_close($con);
?>
I get the error Notice: Undefined variable: result in phone-details.php on line 43 Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in phone-details.php on line 43
What I want it to do is display an image next to the details of the product (Product details were working before but then I tried to get the image working and it broke). The filename is stored in a field named LargeImg and the image file itself is stored in the images/phones folder. How will I fix this so the error is gone and the images display for each record in the database? The simpler the code the better.
Thanks.