Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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']."' >";   
      
    } 
Comment

display image from mysqli database

<?php // Include the database configuration file  require_once 'dbConfig.php';  // Get image data from database $result = $db->query("SELECT image FROM images ORDER BY uploaded DESC"); ?>

<?php if($result->num_rows > 0){ ?>     <div class="gallery">         <?php while($row = $result->fetch_assoc()){ ?>             <img src="data:image/jpg;charset=utf8;base64,<?php echo base64_encode($row['image']); ?>" />         <?php } ?>     </div> <?php }else{ ?>     <p class="status error">Image(s) not found...</p> <?php } ?>
Comment

PREVIOUS NEXT
Code Example
Php :: laravel soft delete example 
Php :: php image resize 
Php :: how to display the database table names list in codeigniter 
Php :: wp_login_form wrong password redirect 
Php :: php count occurrences of string in array 
Php :: Get all Country List using php 
Php :: get server ip php 
Php :: eloquent get trashed record 
Php :: how to get http parameters in php 
Php :: php filter non utf-8 characters 
Php :: php check if multiple inputs are empty 
Php :: php implode 
Php :: laravel get age from date 
Php :: laravel form 
Php :: wherein elequent 
Php :: Generate Unique Random String With Any Character Size | unique random php generator | php unique id generator 
Php :: route group in laravel 
Php :: laravel realation with has 
Php :: how to return chunk data laravel 
Php :: how to get previous date in laravel 
Php :: how make a variable global php 
Php :: php string search in array 
Php :: __invoke in laravel 
Php :: how to install laravel 
Php :: laravel model wherein 
Php :: today date to ago for the date in php 
Php :: https://www.60d48b1061adf.site123/wp-login.php 
Php :: Round the number in php 
Php :: laravel eloquent update 
Php :: throw 403 laravel 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =