PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
// change this to whatever you have as primary key
$id = (int)$_GET['id'];
$query = "SELECT * FROM people WHERE person_id = $id";
$data = mysql_query($query);
$info = mysql_fetch_array($data);
header('Content-type: image/jpeg');
$info['person_photo'];
<!-- change $info['person_id'] to your primary key
Print "<td width='22%' rowspan='5'>Photo: <img src='image.php?id=" . $info['person_id'] . "' alt='whatever' /></td>";
-Shawn
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
<?php
// change this to whatever you have as primary key
$id = (int)$_GET['id'];
$query = "SELECT * FROM people WHERE id = $id";
$data = mysql_query($query);
$info = mysql_fetch_array($data);
header('Content-type: image/jpeg');
$info['person_photo'];
?>
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.