Skip to content

How to retrieve image from database in PHP mysqli?

// database connection
  $conn = mysqli_connect("localhost", "root", "", "student");
// Fetch image from database
	$img = mysqli_query($conn, "SELECT * FROM student_table");
     while ($row = mysqli_fetch_array($img)) {     
      	echo "<img src='images/".$row['imagename']."' >";   
See also  How to measure how much your of cpu your program is using in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.