PHP 透過ODBC 連結 MS SQL 2012 express
01.架設MS
SQL 2012 express
環境教學文件:
http://blog.kkbruce.net/2012/10/microsoft-sql-server-2012-express-donwload-and-install.html#.Vmjg9Ep96Uk
http://www.slideshare.net/yuan817/ms-sql-2012
https://www.dotblogs.com.tw/franma/2012/08/05/73837
http://web.synametrics.com/sqlexpressremote.htm
02.PHP透過ODBC連結MS SQL 2012 express程式碼
<?php
//http://www.programgo.com/article/48613569901/;jsessionid=85BFB10EFD4F2C1C7F7EC17649DB14B4
/**
* @author samsun
* @copyright 2007
* php
使用ODBC连接sql server数据库实例
*/
$server=’127.0.0.1′;
$username=’root’;
$password=’700502……’;
$database=’v78′;
$connstr = “Driver={SQL
Server};Server=$server;Database=$database”;
if ( !odbc_connect($connstr,$username,$password,SQL_CUR_USE_ODBC)){
echo “Couldn’t connect to SQL Server on $server”;
}else{
echo “Connect successfully!<br>”;
}
?>
|