Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php display all rows in mysql table

$sql = "SELECT * FROM MY_TABLE";
$result = mysqli_query($conn, $sql); // First parameter is just return of "mysqli_connect()" function
echo "<br>";
echo "<table border='1'>";
while ($row = mysqli_fetch_assoc($result)) { // Important line !!! Check summary get row on array ..
    echo "<tr>";
    foreach ($row as $field => $value) { // I you want you can right this line like this: foreach($row as $value) {
        echo "<td>" . $value . "</td>"; // I just did not use "htmlspecialchars()" function. 
    }
    echo "</tr>";
}
echo "</table>";
Comment

PREVIOUS NEXT
Code Example
Php :: php get day from date 
Php :: get user ip laravel 
Php :: wp wc php if cart page is empty redirect 
Php :: when image update laravel delete remove image 
Php :: wp config define site url code 
Php :: carbon minus 1 day 
Php :: How to install php-fpm 
Php :: run php server 
Php :: laravel mix purge css 
Php :: wp get user meta 
Php :: codeigniter db where between 
Php :: cast array to object php 
Php :: test a single file laravel 
Php :: php get first character of string 
Php :: php search on array 
Php :: laravel where creation is today carbon 
Php :: php copy image from one folder to another 
Php :: composer memory limit 
Php :: carbon date from format 
Php :: default sort yii2 
Php :: Get html by ajax 
Php :: wait php 
Php :: rollback laravel transaction 
Php :: send variable to get_template_part 
Php :: php session regenerate id 
Php :: Check duplicate email using Jquery validation 
Php :: Making visible or hidden attributes from Eloquent temporarily 
Php :: new line in php 
Php :: how to debug php 
Php :: php mysql datetime format string 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =