0

I would like connect from PHP to SQLServer 2005 by ODBC, but i was not ok.

I have created DNS in control panel already.

Please tell me the solution, why cannot connect ?

I have connected from php to Sqlserver2008 was ok.

Code

odbc_connect("test2", "test2","12345") or die("Fail");

Connection fail
4

3 回答 3

0

看看这个网址http://www.w3schools.com/php/php_db_odbc.asp 这可能会帮助你。

于 2013-05-16T08:58:13.140 回答
0

您可以使用 mssql_connect()。

您可以在此处查看用户贡献的评论。http://www.php.net/manual/en/function.mssql-connect.php

于 2013-05-16T08:59:04.700 回答
0

$cxn = odbc_connect("ODBC_DSN_NAME", "", ""); $sql = "SELECT * FROM some_table'"; $res = odbc_exec($cxn, $sql);

于 2013-05-16T10:21:48.327 回答