亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP development user registration module to create database and table

We continue to use phpMyAdmin to create MySql database and tables.

In the user login chapter we have explained in detail how to create databases and tables

Here we only need to add some variables that our registration module needs to use based on the last login. That's it.

In the login table under the test database, we added the confirmation password and email address.

Set the following fields:

id: It is unique, type is int, and select the primary key.

uesrname: Username, type is varchar, length is 30.

password: Password, type is varchar, length is 30.

confirm: Confirm password, type is varchar, length is 30.

email: Email, type is varchar, length is 30.

<?php
    // 創(chuàng)建連接
    $conn = new mysqli("localhost", "uesename", "password","test");
    // 檢測連接
    if ($conn->connect_error) 
    {    
    die("連接失敗: " . $conn->connect_error);
    } 
    // 使用 sql 創(chuàng)建數(shù)據(jù)表
    $sql = "CREATE TABLE login (
    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(30) NOT NULL,
    password VARCHAR(30) NOT NULL,
    confirm VARCHAR(30) NOT NULL,
    email VARCHAR(30) NOT NULL,
    )ENGINE=InnoDB DEFAULT CHARSET=utf8 ";
    if ($conn->query($sql) === TRUE) 
    {    
    echo "Table MyGuests created successfully";
    } else {    
    echo "創(chuàng)建數(shù)據(jù)表錯誤: " . $conn->error;
    }
    $conn->close(); 
?>

You can also directly create a database and table through phpMyAdmin and directly insert fields

After completion, the table structure is as follows:

1.png

##In this way we The database and tables have been created.

Continuing Learning
||
<?php // 創(chuàng)建連接 $conn = new mysqli("localhost", "uesename", "password","test"); // 檢測連接 if ($conn->connect_error) { die("連接失敗: " . $conn->connect_error); } // 使用 sql 創(chuàng)建數(shù)據(jù)表 $sql = "CREATE TABLE login ( id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY, username VARCHAR(30) NOT NULL, password VARCHAR(30) NOT NULL, confirm VARCHAR(30) NOT NULL, email VARCHAR(30) NOT NULL, )ENGINE=InnoDB DEFAULT CHARSET=utf8 "; if ($conn->query($sql) === TRUE) { echo "Table MyGuests created successfully"; } else { echo "創(chuàng)建數(shù)據(jù)表錯誤: " . $conn->error; } $conn->close(); ?>
submitReset Code