How can i load a picture from a mySQL database using php. The picture is uploaded in a table and then dynamically loaded to a php page. It's attribute in the database table is longblob. [code]while(list($name, $type, $size, $path) = mysql_fetch_array($imgResult)) { $im = open_image($path); if ($im === false) { die ('Unable to open image'); } header ('Content-Type: image/jpeg'); imagejpeg($path); echo 'Opened image'; function open_image($path) { # JPEG: $im = @imagecreatefromjpeg($path); if ($im !== false) { return $im; } # GIF: $im = @imagecreatefromgif($path); if ($im !== false) { return $im; } # PNG: $im = @imagecreatefrompng($path); if ($im !== false) { return $im; } # GD File: $im = @imagecreatefromgd($path); if ($im !== false) { return $im; } # GD2 File: $im = @imagecreatefromgd2($path); if ($im !== false) { return $im; } # WBMP: $im = @imagecreatefromwbmp($path); if ($im !== false) { return $im; } # XBM: $im = @imagecreatefromxbm($path); if ($im !== false) { return $im; } # XPM: $im = @imagecreatefromxpm($path); if ($im !== false) { return $im; } # Try and load from string: $im = @imagecreatefromstring(file_get_contents($path)); if ($im !== false) { return $im; } return false; }[/code]