I would like the image to be displayed inside a table. At the moment I am getting this message when I exectue the file: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
If someone could point me in the right direction I’de really appreciate it.
<tr><td>
<?php
$conn = mysql_connect("...", "...", "...");
mysql_select_db ("...");
$query = ("select * from photos where ID = 3");
$result = mysql_query($query) or die(mysql_error()." ".$query);
while($row = mysql_fetch_array($result))
{
echo "<p>$row[title]</p></ br></ br>";
echo "<img src=' . $row['content'] . ' height='200' width='200'/>";
}
mysql_close($conn);
?>
</td></tr>
It looks like your problem is on this line, because you’re mixing single and double quotes:
echo "<img src=' . $row['content'] . ' height='200' width='200'/>";You could rewrite it like this:
echo "<img src='$row[content]' height='200' width='200'/>";Or like this:
echo "<img src='" . $row[content] . "' height='200' width='200'/>";