View Single Post
  #2 (permalink)  
Old 12-21-04, 09:18 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
using a php script is the sulotion ..
something like that:
PHP Code:

<?PHP

$ID 
= (int)$_GET['ID'];

/* DO MySQL CONNECTION HERE */

$fetch mysql_query("SELECT * FROM image_table WHERE ID='$ID'")or
die(
mysql_error());

$num mysql_num_rows($fetch);

if (empty(
$num))
   
$fullname 'path/to/default_error.png';
else {
   
$images mysql_fetch_assoc($fetch);

   
$image $images['imagename'];
   
$path  $images['imagepath'];

   
$fullname "$path/$image";

   
mysql_query("UPDATE image_table SET counter=counter+1 WHERE ID='$ID'")or
   die(
mysql_error());
}

$fp fopen($fullname'r');
$read fread($fpfilesize($fullname));
fclose($fp);
die(
$read);
?>
and to get the pictures use:
Code:
<img src="image.php?ID=25" alt"" />
or you could use the file name instead of the ID
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote