MYSQL数据复制到ACCESS数据库
类别: 数据库教程
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);
?>
字段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);
?>
- 上一篇: 长期使用中型ACCESS数据库的一点经验
- 下一篇: 在SQL中设置允许同时连接的用户数
-= 资 源 教 程 =-
文 章 搜 索