Mysql databases store data in tables.
For storage of data in the database is necessary that it contains at least one created MySql table.

Create table

To create table in MySql database used PHP function mysql_query().
The table creation command requires: name of the table, names of fields and definitions for each field.
SQL query using CREATE TABLE statement, after that we will execute this SQL query through passing it to the mysqli_query() function to finally create our tableis used to create a table in MySQL.

$dbuser "yourusername";
$dbpass  "yourpassword";
$dbname "yourdatabase";
$conn mysqli_connect($dbhost$dbuser$dbpass $dbname);
if (!
$conn) {
"Connection failed: " mysqli_connect_error());
$sql "CREATE TABLE members (
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
email VARCHAR(50),
reg_date TIMESTAMP
if (
mysqli_query($conn$sql)) {
"Table members created successfully";
} else {
"Error creating table: " mysqli_error($conn);

Privacy Policy