how to create a table in mysql using php

If you want to create a table, you can run the CREATE TABLE statement as shown in the following :

CREATE TABLE statement
<?php
$con=mysqli_connect(“example.com”,”user”,”pass”,”my_db”);
// Check connection
if (mysqli_connect_errno()) {
echo “Failed to connect to MySQL: ” . mysqli_connect_error();
}

// Create table
$sql=”CREATE TABLE users(FirstName CHAR(30),LastName CHAR(30),Age INT)”;

Read more