高分求救:这里还没有人解决的问题??? 可以啊,要用odbc,php有专门的odbc的函数。不然可以用ado的组件,PHP可以调用组件的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用ODBC较简单,1、操作步骤:在数据库服务器上建立一个DSN2、代码示例:$conn = odbc_connect($odbc_dsn, $odbc_user, $odbc_password);$result = odbc_exec($conn, "select test from test");while(odbc_fetch_row($result)) { echo odbc_result($result,"test");}odbc_free_result($result);odbc_close($conn); 能够,要在linux上安装freetds或者sybase的客户端http://www.neweasier.com/article/2002-08-12/1029137081.htmlhttp://netschool.ayinfo.ha.cn/zlinuxfwmssql.htm这两篇文章应该有用的 http://expert.csdn.net/Expert/topic/1204/1204174.xml?temp=.2742884 文档中心有篇文章,专门讲ADODB和php的,不知道是谁写的 如何连接MSSQL....(转摘)作者 : leechiawen 测试平台 Redhat 7.2 + MSSQL 2000 SERVER需要软体包 apache,php,freetds<首先安装redhat 7.2><检查有无安装apache>rpm -qa | grep apache若是有出现,表示有已经有安装了apache-1.3.20-16apacheconf-0.8.1-1apache-manual-1.3.20-16apache-devel-1.3.20-16到http://www.freetds.org下载freetds-0.53.tgz到http://www.php.net下载php-4.1.1.tar.gz假设下载於/tmp目录下执行以下命令cd /tmptar -zxvf freetds-0.53.tgztar -zxvf php-4.1.1.tar.gz完成後会出现两个目录freetds-0.53php-4.1.1<安装freetds>执行以下命令# cd /tmp/freetds-0.53# ./configure --prefix=/usr/local/freetds--with-tdsver=4.2 \--enable-msdblib \--enable-dbmfix# make# make install<安装php>执行以下命令# cd /tmp/php-4.1.1# ./configure --prefix=/usr/local/php-4.1.1 \--with-apxs=/usr/sbin/apxs \--with-sybase=/usr/local/freetds \--enable-track-vars# make# make install<完成後激活apache server># service httpd start<测试PHP连接MSSQL的功能>在/var/www/html/目录下产生一个测试用的php档,例如:test.php内容如下假设要连接在MSSQL(192.168.0.100)中,数据库为'mydatabase'中的'counter'资料表正常的话,就会回应有多少比资料在counter的资料表中------------------------------------------------------------$user = "myname";$pass = "mypass";$db = "mydatabase";$link = mssql_connect("192.168.0.100", $user, $pass );if( ! $link ) die( "Could not Connect MSSQL" );mssql_select_db( $db, $link ) or die( "Could not open $db" );$result = mssql_query( "select * from counter" );$num_rows = mssql_num_rows( $result );print "There are currently $num_rows in the table";mssql_close( $link );------------------------------------------------------------- ie解析php的工作方式实在是不太理解 求助:需求分析报告的写法? 利用支付宝返回参数更新数据库 (PHP) 使用iconv却无法写入数据库 apache测试成功 php测试成功 mysql服务可以启动 mysql_connect()没定义?? 请教达人 or的2句SQL的ike怎么按like的先后排列数据? php中全局变量在多个文件中引用问题 php老是抱的一个错误,自己看不懂,高手帮忙看看,谢谢! PHP NEWBIE需要注意的一些问题 mysql如何把datetime类型转成date类型? 请问一个投票系统怎么写! redhat 7.2 php apache
1、操作步骤:
在数据库服务器上建立一个DSN
2、代码示例:
$conn = odbc_connect($odbc_dsn, $odbc_user, $odbc_password);
$result = odbc_exec($conn, "select test from test");
while(odbc_fetch_row($result)) {
echo odbc_result($result,"test");
}
odbc_free_result($result);
odbc_close($conn);
http://www.neweasier.com/article/2002-08-12/1029137081.html
http://netschool.ayinfo.ha.cn/zlinuxfwmssql.htm
这两篇文章应该有用的
测试平台 Redhat 7.2 + MSSQL 2000 SERVER
需要软体包 apache,php,freetds<首先安装redhat 7.2><检查有无安装apache>
rpm -qa | grep apache若是有出现,表示有已经有安装了
apache-1.3.20-16
apacheconf-0.8.1-1
apache-manual-1.3.20-16
apache-devel-1.3.20-16到http://www.freetds.org下载freetds-0.53.tgz
到http://www.php.net下载php-4.1.1.tar.gz假设下载於/tmp目录下
执行以下命令
cd /tmp
tar -zxvf freetds-0.53.tgz
tar -zxvf php-4.1.1.tar.gz
完成後会出现两个目录
freetds-0.53
php-4.1.1
<安装freetds>
执行以下命令
# cd /tmp/freetds-0.53
# ./configure --prefix=/usr/local/freetds
--with-tdsver=4.2 \
--enable-msdblib \
--enable-dbmfix
# make
# make install<安装php>
执行以下命令
# cd /tmp/php-4.1.1
# ./configure --prefix=/usr/local/php-4.1.1 \
--with-apxs=/usr/sbin/apxs \
--with-sybase=/usr/local/freetds \
--enable-track-vars
# make
# make install<完成後激活apache server>
# service httpd start<测试PHP连接MSSQL的功能>
在/var/www/html/目录下产生一个测试用的php档,例如:test.php内容如下
假设要连接在MSSQL(192.168.0.100)中,数据库为'mydatabase'中的'counter'资料表正常的话,就会回应有多少比资料在counter的资料表中
------------------------------------------------------------
$user = "myname";
$pass = "mypass";
$db = "mydatabase";$link = mssql_connect("192.168.0.100", $user, $pass );if( ! $link ) die( "Could not Connect MSSQL" );mssql_select_db( $db, $link ) or die( "Could not open $db" );$result = mssql_query( "select * from counter" );$num_rows = mssql_num_rows( $result );print "There are currently $num_rows in the table";mssql_close( $link );
-------------------------------------------------------------