##Field name | id | username | userpwd |
Field type | ##int | varchar | varchar |
Field length10 | 20 | 20 | |
Field description | Number | Username | Password |
Next, let’s create the database
Database creation
We are using phpMyAdmin To create a simple database
First log in to the database. The username and password were set when we installed the database. My username and password are both root
![1477619273366835.png sql1.png](https://img.php.cn/upload/image/973/830/167/1477619273366835.png)
After successful login, click Database on the top page , Then fill in the name of the database we want to create under the new database , and select utf8_general_ci for encoding (multi-language, case-insensitive)
![1477619499555626.png 1.png](https://img.php.cn/upload/image/925/936/434/1477619499555626.png)
#Click to create:
![1477619877251332.png 2.png](https://img.php.cn/upload/image/199/370/915/1477619877251332.png)
Now we create a data table containing three fields in the database![1477619960495552.png 3.png](https://img.php.cn/upload/image/819/829/324/1477619960495552.png)
Click Execute and fill in the details of each field ( Note: You need to choose an auto-increment for the id field, that is, select the option A_I):
##After filling in, click Save:
Okay, at this point, the database required for this project has been built
Note: If you can’t see the picture clearly, right-click on the picture Select View Picture to see the big pictureNext Section
<!DOCTYPE html>
<html>
<head>
<title>php.cn</title>
<meta charset="utf-8" />
<style>
.box{
width:250px;
height:120px;
background:#f0f0f0;
}
</style>
</head>
<body>
<!-- 注册界面 register.php-->
<div class="box">
<form action="regcheck.php" method="post">
<table>
<tr>
<td align="right">用户名:</td>
<td><input type="text" name="username" value="请输入用户名" maxLength="6"/></td>
</tr>
<tr>
<td align="right">密 码:</td>
<td><input type="password" name="userpwd" maxLength="6"/></td>
</tr>
<tr>
<td align="right">确认密码:</td>
<td><input type="password" name="confirm" maxLength="6"/></td>
</tr>
<tr>
<td colspa="2" align="right"><input type="Submit" name="Submit" value="注册"/></td>
</tr>
</table>
</form>
</div>
</body>
</html>