display image php – How to Display Image in PHP from Folder/Directory?

0
()

display image php dynamically echo an image php from mysql database Example. Firstly, create a connection to the MySQL database.

how to display image in php?

echo "<img src='movies/movie-name.JPG' >";  

Free Live Chat for Any Issue

i will get the image content from the MySQL database as well as list them on the web page.

display image php from Folder

<html>
 <head>
 <title>how to display an image in php from mysql database example</title>
 </head>
 <body>
 <p>How to fetch image from database in PHP and display in table?</p>
	<?php
 
	echo "<img src='movie-name.png' >"; 

	?>  
 </body>
 </html>

How to Display Image from Database in Php?

<html>
 <head>
 <title>how to display an image in php from mysql database example</title>
 </head>
 <body>
 <p>How to fetch image from database in PHP and display in table?</p>
	<?php
	$link = mysqli_connect("localhost", "root", "[email protected]", "movie");
	$movie_info  = mysqli_query($link, "SELECT * FROM movie_table");
     while ($row = mysqli_fetch_array($movie_info)) {     
      	echo "<img src='movies/".$row['imagename']."' >";   
    }     
	?>
 </body>
 </html>

Download

I hope you get an idea about how to display an image in php from mysql database example?.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Read Also:  Laravel JSON Array Merge into one array

How useful was this post?

Click on a star to rate it!