I am working on one project which uses oracle as a database.
According to requirement I have to store image on oracle database in blob(datatype) and retrieve that stored image and show in a web page.
If I am doing so,I am getting a broken image the code is shown below:
Expand|Select|Wrap|Line Numbers
- $query = $pdo->prepare("SELECT image,type FROM image where s_date = ? ");
- $query->execute(array($dat));
- $res = $query->fetchAll();
- foreach ($res as $result){
- echo '<img height="300" width="500" src="data:'.$result['type'].';base64,' . base64_encode($result['image']) . '" />';
- }