Previous images work fine but now the images i'm adding aren't loading
The source for the old ones that work and the new ones that don't is the exact same.
This is the code
Code: Select all
<?php
// some basic sanity checks
if(isset($_GET['image_id']) && is_numeric($_GET['image_id'])) {
//connect to the db
$link = mysql_connect("localhost", "", "") or die("Could not connect: " . mysql_error());
// select our database
mysql_select_db("people") or die(mysql_error());
// get the image from the db
$sql = "SELECT Picture FROM people WHERE ID=" . $_GET['image_id'];
// the result of the query
$result = mysql_query("$sql") or die("Invalid query: " . mysql_error());
// set the header for the image
header("Content-type: image/jpeg");
echo mysql_result($result, 0);
// close the db link
mysql_close($link);
}
else {
echo 'Please use a real id number';
}
?>
This one doesn't work:
Code: Select all
<img style='float:right' width='80px' height='80px' src='image.php?image_id=70' alt='Photo' />Code: Select all
<img style='float:right' width='80px' height='80px' src='image.php?image_id=131' alt='Photo' />