First, PHP configuration MySQL
1, copy the PHP installation directory under the Php_mysql.dll and MySQL installation directory libmysql.dll files to C:/windows/system32;
2, Configuration PHP.ini
Extension=php_gd2.dll
Extension=php_mbstring.dll
Extension=php_mysql.dll
Extension=php_mysqli.dll
put the top four. dll above the front;
Second, the implementation of the PHP form submission to the database process
1. login.php page
<span style= "FONT-SIZE:14PX;" >
2. add.php Page<span style= "FONT-SIZE:14PX;" ><?phpinclude ("conn.php");? ><?phpif (Isset ($_post["Submit")) { $sql = "INSERT into users (username, email) VALUES (' $_post[username] ', ' $ _post[email] "Mysqli_query ($conn, $sql); echo" Add Success ";}? ></span>
3. conn.php Page<span style= "FONT-SIZE:14PX;" ><?php$conn = new Mysqli ("localhost", "root", "159357"), $conn->select_db ("Db_test");//mysql_query ("Set name ' gb2312 '); $conn->set_charset ("UTF8");? ></span>