Php+sql creating a local project detailed steps to create a database data table, database connection

Source: Internet
Author: User
Tags php error

One, we use WAMP, first guarantee Wamp open, service open state

Second, create the database, create the table

Note that the data set here is to choose UTF8, otherwise the insert data will be garbled to create table selection advanced properties, also set the dataset can set the ID as the primary key and self-growth so that the database shoes is created, and there is an empty table shoes_jd_wx. Third, connect the database to create the file dblink.php
<?PHPHeader("Content-type:text/html;charset=utf-8");//Set charactererror_reporting(0);//Block PHP Error$dblink=mysql_connect("localhost", "root", "");//database account, password, here the password is emptymysql_select_db("Shoes");//Databasemysql_query("SET NAMES UTF8");//Set character/*if ($dblink) {//can determine if the successful link was successfully linked;} else{echo "link Failed";}*/?>

Php+sql creating a local project detailed steps to create a database data table, database connection

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.