How to display image from database using php

前端 未结 11 2698
闹比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条回答
  •  Happy的楠姐
    2020-11-27 22:18

    put you $image in img tag of html

    try this

    echo '';
    

    instead of

    print $image;
    

    your_path_to_image would be absolute path of your image folder like eg: /home/son/public_html/images/ or as your folder structure on server.

    Update 2 :

    if your image is resides in the same folder where this page file is exists
    you can user this

    echo '';
    

提交回复
热议问题