[php&mysql&javascript] Preloading pictures from database
| From: | Siim Einfeldt aka Itpunk | Date: | Tue, 09 Jan 2001 20:14:54 +0000 |
| Subject: | [php&mysql&javascript] Preloading pictures from database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-33531@lists.php.net to get a copy of this message | ||
Hi,
I would use some help. I have written all my pictures to a database and
now I need to make mouseovers with these pictures. Right now my picture
displaying 'systems' (good word...) is the following.
<IMG SRC='showpic.php?picid=$picid' width=177 height=117>
and this is showpic.php
<?php
$query = "SELECT * FROM pildid WHERE picnr='0'";
$result = mysql_db_query("bt", $query);
$r = mysql_fetch_array($result);
Header("Content-Type: {$r[file_type]}");
echo $r["file_data"];
exit();
?>
And usually I use the following code for picture preload:
<script language="Javascript">
<!--
if (document.images) {
pilt1 = new Image();
pilt1.src="pildid/pilt1.jpg";
pilt2= new Image();
pilt2.src="pildid/pilt2.jpg";
}
function vaheta(a,b) {
if (document.images){
document.images[a].src=eval(b + ".src");
}
}
//-->
</script>
Now, if anyone could tell me how to preload all the needed pictures from
the database and then show them on mouseovers, please let me know asap.
NB: if possible, send one copy to my private email as well.
Thank you in advance.
Siim Einfeldt