Location: PHPKode > projects > Music and Discography Database > music_db/images.php
<?
$img = $_GET[img];

require("common_funcs.php");
connectSQL();

query("SELECT image,mime,pg FROM cover WHERE album_id=$img");
if ($nur) {
    $r = next_row();
    if ($r[pg] == 1)
        $img = pg_unescape_bytea($r[image]);
    else $img = $r[image];
    $mime = $r[mime];
    #$img_res = imagecreatefromstring($img);
    header("Content-Type: $mime");
    echo $img;
    #imagegif($img_res);
}
else {
    $img_res = imagecreatefrompng ( "images/nocover.png" );
    header('Content-Type: image/png');
    imagepng($img_res);
}
closeSQL();
?>
Return current item: Music and Discography Database