1 / 4
Computer Service
2 / 4
Networking Service
3 / 4
Web Development Service
4 / 4
Software Development Service
TNW - ICT Solutions
  • Home
  • Available Courses 
  • Available Services 
  • Website Samples 
  • Search Log In
  • <?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.';
    }
    ?>