PHP Database Programming

Source: Internet
Author: User
PHP Database Programming PHP has three methods to operate our database: 1. MySQL extension library 2. mysqli extension Library 3. PDO Differences between MySQL extension library and MySQL database Next we will introduce the MySQL extension Library: 1. MySQL database is used to store data 2. The three-tier structure of MySQL database: all databases basically follow these three structures, 3. MySQL extension library is a bunch of functions provided by PHP designers Program Complete various MySQL database operations (crud) Use the MySQL extension library of PHP to perform database operations: 1. Establish the environment 1.1 enable MySQL extension Library
 
 
Configure the MySQL extension library in the PHP. ini file Extension = php_mysql.dll Extension = php_mysqli.dll We can use <? PHP phpinfo ();?> To check which database functions are currently supported 1.2 create a user table for our use
 
Create Table user1 (ID int primary key auto_increment, name varchar (32) not null, password varchar (64) not null, email varchar (128) not null, age tinyint unsigned not null)

Insert data 

 
Insert into user1 (name, password, email, age) value ('jsh', MD5 ('000000'), '2017 @ QQ.com ', 20)

Here we encrypt the password
When the user name is a Chinese character, an error is returned. You need to set it.




 

    • Previous:PHP self-learning path ------- File Download
Top
0
Step on
0

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.