Search
 
SCRIPT & CODE EXAMPLE
 

PHP

retrieve data from database xampp

<!DOCTYPE html>
<html>
<head>
  <title>Fetch image from database in PHP</title>
</head>
<body>

<h2>All Records</h2>

<table border="2">
  <tr>
    <td>Sr.No.</td>
    <td>Name</td>
    <td>Images</td>
  </tr>

<?php

include "dbConn.php"; // Using database connection file here

$records = mysqli_query($db,"select * from tbltest"); // fetch data from database

while($data = mysqli_fetch_array($records))
{
?>
  <tr>
    <td><?php echo $data['id']; ?></td>
    <td><?php echo $data['fname']; ?></td>
    <td><img src="<?php echo $data['images']; ?>" width="100" height="100"></td>
  </tr>	
<?php
}
?>

</table>

<?php mysqli_close($db);  // close connection ?>

</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Php :: Laravel 9 Multiple File Upload 
Php :: seeder name singular or plural laravel 
Php :: how to create php message 2 
Php :: php group subarrays by column key 
Php :: How to get only content-length with CURL PHP? 
Php :: get product price with thousands separator 
Php :: phpunit exception message contains string 
Php :: not have permision elgg settings.php 
Php :: yii2 gridview get selected rows 
Php :: php phalcon 
Php :: form alter drupal 9 language code 
Php :: php convert html code to text 
Php :: how to store api response to avariable in phpp 
Php :: laravel auditing tray publishing 
Php :: powerpack add custom image size 
Php :: where clause with paginate laravel multiple column 
Php :: laravel filemanger choose multiple images 
Php :: php registration form and login in same page 
Php :: lowercase in array php 
Php :: Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/7.4.29 Server at localhost Port 8080 
Php :: php query 
Php :: php catch mysqli_connect(): (HY000/1045): Access denied 
Php :: error logs wp 
Php :: php code to submit a radio button value using onclick function 
Php :: declare variable in view for loop laravel 
Java :: print hello world in java 
Java :: how to clear terminal in java 
Java :: how to create new frame with java swing 
Java :: java check if number is even 
Java :: message box in javafx 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =