澳门新萄京mysql数据复制到access数据库

将mysql数据导入access数据库:

mysql数据库表sqltable
字段id,name,sex,email

mysql数据库表sqltable
字段id,name,sex,email
access数据库表accesstable
id,name,sex,email
<?
$connect = mysql_connect(“localhost”,””,””);
mysql_select_db(“mydatabase”);
$sql = “select * from sqltable;
$result = mysql_query($sql};
$connectodbc=odbc_connect(“DSN”,”USERNAME”,”PASSWORD”);
while($row = mysql_fetch_row($result))
{
$sql=”insert into accesstable
values($row[“id”,$row[“name”,$row[“sex”],$row[澳门新萄京,”email”])”;
odbc_do($connectodbc,$sql);
}
odbc_close($connectodbc);
mysql_close($conect);
?>
【本文版权归小编与奥索网共同持有,如需转发,请表明笔者及出处】

$connect = mysql_connect(“127.0.0.1″,”root”,””) or die
(“链接错误”);//开启链接到mysql
$select_db =
mysql_select_db(“数据库名”,$connect);//如若不特意注明连接标示符,则暗中同意上一回展开的链接
//执行SQL语句!
$sql = “SELECT * FROM test”
$query = mysql_query($sql,$connect) or die(mysql_error());

mysql数据库表sqltable
字段id,name,sex,email

values($row[“id”,$row[“name”,$row[“sex”],$row[“email”])”;
odbc_do($connectodbc,$sql);
}
odbc_close($connectodbc);
mysql_close($conect);
?>

//用于计算查询结果的多少
mysql_num_rows($query);
//传回最终二次选拔INSERT指令的IP
mysql_insert_id($query);
//获得数据库名
mysql_tablename($query);
//再次来到错误音讯
mysql_error();
//关闭链接
mysql_close();

<?
$connect = mysql_connect(“localhost”,””,””);
mysql_select_db(“mydatabase”);
$sql = “select * from sqltable;
$result = mysql_query($sql};
$connectodbc=odbc_connect(“DSN”,”USERNAME”,”PASSWORD”);
while($row = mysql_fetch_row($result))
{
$sql=”insert into accesstable

access数据库表accesstable
id,name,sex,email

上面是带详细表明的代码

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图