The most viewed posts

About Me

Contact Me

Myanmar font and keyboard for Windows

Registry Reviver

IT Support & Endpoint Management

Digital Platforms & Web Solutions

How to clean up Windows Computer

Driver Booster

CCleaner

About Desktop Icons in Windows Computer

The most viewed items

Dell Inspiron 5559

SONY Playstation Portable

HP ProBook 430

Laptop RAM

External Hard Disk

Laptop

Desktop Hard Disk

Please login to start chat

ZilaStar ICT Jun 22 2019, 19:05:36
Category : PHP Tutorials

Creating table in a database

<?php
$server = 'localhost';
$username = 'root';
$password = '';
$db = 'TNW';
$conn = mysqli_connect($server, $username, $password, $db);
if($conn){
$query = "CREATE TABLE `username`(
UserId int(30) NOT NULL AUTO_INCREMENT PRIMARY KEY,
FirstName varchar(30) NOT NULL,
LastName varchar(30) NOT NULL,
UserName varchar(30) NOT NULL,
Password varchar(50) NOT NULL
)";
$query_run = mysqli_query($conn, $query);
if($query_run){
echo 'Successfully created a table.';
}else{
echo 'Creating a table Error.';
}
}else{
echo 'Connecting to a database Error.';
}
?>

Comments:

No comment.

To Contact
🙏 About Me
📜Terms and Conditions