PHP import MSSQL data into the MySQL database _php tutorial

Source: Internet
Author: User
Tags mssql server mysql tutorial
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 ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.