|
Posted by Janwillem Borleffs on 01/15/06 03:05
gooze wrote:
> Actually the problem is not the selection from the DB, the real
> problem is, how do I display the pictures in the browser after I have
> them in the array? There are binary data in the queries result, and I
> have to feed the browser with it...
>
You could try to use someting based on the following:
<?php
session_start();
if (isset($_SESSION['img']) && isset($_GET['show'])) {
header("Content-Type: image/jpeg");
print base64_decode($_SESSION['img']);
exit;
}
// Prepare some test data
$binary = file_get_contents('103.jpg');
$array = array_fill(0, 3, $binary);
foreach ($array as $e) {
$_SESSION['img'] = base64_encode($e);
// Timestamp appended to prevent caching
echo '<img src="', $_SERVER['PHP_SELF'], '?', time(), '&show=1" />';
}
?>
JW
Navigation:
[Reply to this message]
|