I have been working on this dynamic page that displays data from the MySQL database, and most of it works but the part where i need it to display and image gives me a error. the script is a mile long so i will just post the part thats not working.
This is lines 227-259 and it says the error is on line 245.
<?php $pic =
### Connect to MySQL ###
// Connect to the server
$connect = mysql_connect('localhost','*******','*******') or die(mysql_error());
// Select the database
$select = mysql_select_db('DB_nac74175') or die(mysql_error());
$sql = "SELECT * FROM $table WHERE name = '$name' OR sci_name = '$sci'";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result,1))
{
echo $row['pic'];
} ;
?>
<?php if (file_exists($pic)) {
echo "<img src="$connect = mysql_connect('localhost','nac74175','sarge') or die(mysql_error());
// Select the database
$select = mysql_select_db('DB_nac74175') or die(mysql_error());
$sql = \"SELECT * FROM $table WHERE name = '$name' OR sci_name = '$sci' ";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result,1))
{
echo $row['pic'];
}
">" ;
}else{
echo "Sorry, no picture available at this time.";
}
?>