SHARE
TWEET

Untitled

a guest Aug 24th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $db = mysqli_connect("localhost", "root", "", "dbname"); // keep your db name
  2. $sql = "YOUR SQL CODE FOR RETRIEVING THE RECORD WHICH HOLDS YOUR IMAGE CONTENT";
  3. $sth = $db->query($sql);
  4. $result = mysqli_fetch_array($sth);
  5. echo '<img src="data:image/jpeg;base64,'.base64_encode( $result['image'] ).'"/>'; // ASSUME THAT "image" IS THE NAME OF YOUR COLUMN WHICH HOLDS DATA ABOUT YOUR IMAGE
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top