PHP Access database conversion to MySQL database code (1/2)

Source: Internet
Author: User
Tags character set access database mysql database

///Access library convert to MySQL database tutorial The friend who does not understand can add qq:345838256/////////////////////////////////
//I collect data is access, But my program is MySQL, so write a program, the program three steps to share ... Friends who like to manipulate the database should be used.///////
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////1. Connection mysql/////////////////////////////// /////////////////////////////

The code is as follows Copy Code
$dbhost = "localhost:3307";//server
$db = "Dataname";//Database
$dbuser = "root";//user name
$dbpass = "*******";//Password
$db _qianzhui= "sdb_";//Table Prefix
$link =mysql_connect ($dbhost, $dbuser, $dbpass);
if (! $link) echo "link failed!";
else echo "Success!!!";
mysql_query ("SET NAMES ' UTF8 '"); //////////////////////////
mysql_query ("Set CHARACTER set UTF8"); >>> Solve Chaos
mysql_query ("SET Character_set_results=utf8 '");/////////////>>> code problem
mysql_select_db ("{$db}");//////////////////////////////////

home 1 2 last
Related Article

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.