a guest Aug 24th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- $db = mysqli_connect("localhost", "root", "", "dbname"); // keep your db name
- $sql = "YOUR SQL CODE FOR RETRIEVING THE RECORD WHICH HOLDS YOUR IMAGE CONTENT";
- $sth = $db->query($sql);
- $result = mysqli_fetch_array($sth);
- 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