Page 1 of 1

can i skip a page?

Posted: Sat Mar 11, 2006 3:37 pm
by modplod
hi,

I need help with this.

I have this

Code: Select all

$out .= "<img src=\"thumbnail.php?id=12345\" width=\""."80"." height="."60".">";
which uses this

Code: Select all

<?php 
header("Content-type: image/jpeg"); // act as a jpg file to browser 
$oDatabase = mysql_connect("localhost", "user_id", "password"); 
mysql_select_db("your_database_name", $oDatabase); 
$sQuery = "SELECT thumbnail FROM your_table WHERE id = $nId"; 
$oResult = mysql_query($sQuery, $oDatabase); 
$oRow = mysql_fetch_array($oResult); 
$sJpg = $oRow["thumbnail"]; 
echo $sJpg; 
?>
now is there a way to do this without reading another file from the disk?

(mission = fewest disk reads per page view) :?

Posted: Sat Mar 11, 2006 3:49 pm
by feyd
Store the image binary inside your script. I think it's retarded, but I've seen it done.

Posted: Sat Mar 11, 2006 4:01 pm
by modplod
As thats way over my head and seems a little redundant to my objectives, I think I'll skip it