Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2.     $DBHOST = "localhost";
  3.     $DBUSER = "root";
  4.     $DBPASS = "";
  5.     $DBNAME = "seila";
  6.     header('Content-Type: image/jpeg');
  7.     $mysql = new MySQLi($DBHOST,$DBUSER,$DBPASS,$DBNAME);  
  8.     $id = $mysql->real_escape_string($_GET['id']);
  9.     $sql = "SELECT imagem FROM imagens WHERE id = $id; --";
  10.     $imagem = $mysql->Query($sql);
  11.        if ( !$imagem ) {
  12.            echo $mysql->error;
  13.        }
  14.        $img= $imagem->fetch_assoc();
  15.     $img = $img['imagem'];
  16.     echo $img;
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement