Home > php教程 > php手册 > php access 数据库转换到mysql数据库代码(1/2)

php access 数据库转换到mysql数据库代码(1/2)

WBOY
Release: 2016-06-13 10:07:37
Original
861 people have browsed it

php教程 access 数据库教程转换到mysql教程数据库代码
//《ACCESS数库转换成MYSQL数据库教程》看不懂的朋友可加QQ:345838256/////////////////////////////////
//本人采集来的数据是ACCESS的,但我的程序是mysql的,故写了一个程序,程序三步走,分享一下...喜欢操作数据库的朋友应该都会用到的.///////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////1.连接mysql////////////////////////////////////////////////////////////

$dbhost="localhost:3307";//服务器
$db="dataname";//数据库
$dbuser="root";//用户名
$dbpass="*******";//密码
$db_qianzhui="sdb_";//表前缀
$link=mysql_connect($dbhost,$dbuser,$dbpass);
if(!$link) echo "链接失败!";
else echo "成功!!!";
mysql_query("SET NAMES 'UTF8'"); //////////////////////////
mysql_query("SET CHARACTER SET UTF8"); /////////////////////>>>解决乱
mysql_query("SET CHARACTER_SET_RESULTS=UTF8'");/////////////>>>码问题
mysql_select_db("{$db}");////////////////////////////////// 

1 2

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template