Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Displaying all table names in php from MySQL database


$servername = "localhost";
$username = "root";
$password = "";
$dbname = "dbms";

$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "show tables LIKE '%student%'";

$result = mysqli_query($conn, $sql); // run the query and assign the result to $result
while($table = mysqli_fetch_array($result)) { // go through each row that was returned in $result
    echo($table[0] . "<BR>");    // print the table that was returned on that row.

}
Comment

PREVIOUS NEXT
Code Example
Php :: array filter use key 
Php :: bind in pdo 
Php :: laravel new project command 
Php :: laravel eloquent get only field name 
Php :: remove repeated columns laravel 
Php :: php json request get value 
Php :: laravel mongodb field delete (key delete) (column delete) drop 
Php :: php server 
Php :: laravel decrement 
Php :: php function to convert string to camelcase 
Php :: add column in existing table in laravel 
Php :: How to copy all files from one folder to another in PHP? 
Php :: how to check exist in array in rule validation laravel 
Php :: how to add newline in php 
Php :: group in route in laravel 
Php :: csv to array in php 
Php :: Using middleware auth laravel in controller constructor 
Php :: datediff in hour query builder laravel 
Php :: run composer with different php version 
Php :: composer cache clean 
Php :: get key by value array php 
Php :: php force download csv 
Php :: Woocommerce Display field value on the admin order edit page [Custom Field Display 2] 
Php :: php multi type parameter union types 
Php :: nav active in laravel 
Php :: update-alternatives java 
Php :: custom post type 
Php :: post type taxonomy loop wordpress 
Php :: laravel get url path 
Php :: php mysql insert date time 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =