<?php
$connection = mysqli_connect("localhost","root","","php_sample_login_register");
if ($connection){
echo "DB is Connected <br>";
$sql = "CREATE TABLE user(
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255)NOT NULL,
email VARCHAR(255)NOT NULL,
password VARCHAR(255) NOT NULL
);";
if(mysqli_query($connection,$sql)) {
echo "Created user table";
} else{
echo "User table already exists";
}
} else {
echo "error : DB isnot connected";
} ?>