Home > Article > Backend Development > Convert php access database to mysql database code (1/2)_PHP tutorial
php tutorial access database tutorial to convert to mysql tutorial database code
//"Tutorial on converting ACCESS database into MYSQL database" If you don't understand it, please add QQ:345838256///////////////////////////// /////
//The data I collected is from ACCESS, but my program is from mysql, so I wrote a program with three steps. I want to share it...Friends who like to operate databases should all use it.//// ///
///////////////////////////////////////////////////// ///////////////////////////////////////////////////// //////////////
/////////////////////////////////////1. Connect to mysql//////////// //////////////////////////////////////////////////
$dbhost="localhost:3307";//Server
$db="dataname";//Database
$dbuser="root";//Username
$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 the chaos
mysql_query("SET CHARACTER_SET_RESULTS=UTF8'");//////////////>>>Code problem
mysql_select_db("{$db}");///////////////////////////////////
1 2