PHP to import MSSQL data into the MySQL database first to understand how we import the MSSQL server data into the MySQL database, the first to install the MSSQL Server 2000 on your machine, but also to let your machine support php+ Apache+mysql or Php+iis+mysql, well, one of these we can start importing data.
PHP Tutorial to import MSSQL data into the MySQL Tutorial database tutorial
Home to understand how we import MSSQL server data into the MySQL database, first to install the MSSQL Server 2000 on your machine, but also to let your machine support Php+apache+mysql or Php+iis+mysql , okay, one of these we can start importing data.
*/
MSSQL Server and PHP connection
$MCN = mssql_connect (' 127.0.0.1 ', ' sa ', ' 1 ');
mssql_select_db (' HB ', $MCN);
MySQL database connection
$conn = mysql_connect (' localhost ', ' root ', ' a ') or Die (' MySQL server connection failed ');
mysql_select_db (' sa ', $conn);
$mssql = "SELECT * from BC";
$msquery = Mssql_query ($mssql); Querying MSSQL server for data saving to data
if (Mssql_num_rows ($msquery))
{
while ($rs = Mssql_fetch_array ($msquery))
{
$mysql = "INSERT into VV (id,title) VALUES (' $rs [id] ', ' $rs [title] ')"; MySQL Query statement
mysql_query ($mysql);//save data from MSSQL server to MySQL database
}
}
Else
{
Echo ' MSSQL server has no data ';
}
/*
Ok finally finished, in fact, the method is very simple is to connect two databases at the same time, and then the MSSQL data read out to save to the data, and then saved to the MySQL database.
This site original article annotated source www.bKjia.c0m/phper/php.html
*/
http://www.bkjia.com/PHPjc/630821.html www.bkjia.com true http://www.bkjia.com/PHPjc/630821.html techarticle PHP to import MSSQL data into the MySQL database first to understand how we import the MSSQL server data into the MySQL database, the first to install the MSSQL server on your machine ...