How to display image from database using php

前端 未结 11 2713
闹比i
闹比i 2020-11-27 21:43

I am trying to display an image coming from the database and I was not able to display the image .but its showing like this user-1.jpg Please see my code can on

11条回答
  •  伪装坚强ぢ
    2020-11-27 22:19

    Displaying an image from MySql Db.

    $db = mysqli_connect("localhost","root","","DbName"); 
    $sql = "SELECT * FROM products WHERE id = $id";
    $sth = $db->query($sql);
    $result=mysqli_fetch_array($sth);
    echo '';
    

提交回复
热议问题