Mam taką funkcję która pobiera dane z bazy danych informacje o obrazku a potem go wyświetla.
[PHP] pobierz, plaintext
- <?php
- function image_show()
- {
- $id = $_REQUEST['id'];
- $getpic = mysql_query("SELECT * FROM engine_image WHERE image_id= '$id'")
- or die(mysql_error());
- $rows = mysql_fetch_array($getpic);
- extract($rows);
- $image_filename= "gallery/" . $image_id . ".jpg";
- list($width, $height, $type, $attr) = getimagesize($image_filename);
- ?>
- <img src="<?php echo $image_filename; ?>">
- <?php
- }