在linux下用php怎样连接远程sql server数据库哦 linux下装sybase的客户端,配置远程服务器,php用sybase的函数操作. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用ADO链接MSSQL:<?php include('adodb.inc.php');include('tohtml.inc.php'); $database = 'mssql'; $db = ADONewConnection($database); $db->debug = true; $Global['debug'] = 1; $host = '数据库服务器';$user = '用户名';$pwd = '密码';$database = '数据源'; $db->Connect($host, $user, $pwd,$database); ?>用函数链接:function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true) { $this->persistency = $persistency; $this->user = $sqluser; $this->password = $sqlpassword; $this->server = $sqlserver; $this->dbname = $database; $this->db_connect_id = ( $this->persistency ) ? mssql_pconnect($this->server, $this->user, $this->password) : mssql_connect($this->server, $this->user, $this->password); if( $this->db_connect_id && $this->dbname != "" ) { if( !mssql_select_db($this->dbname, $this->db_connect_id) ) { mssql_close($this->db_connect_id); return false; } } return $this->db_connect_id; } 楼上的,人家是说在LIUNX下的我也是刚解决这个问题,一句话:freetds wanbb(wanbb) 我装了freetds 但还是连不上咯 我用mssql_connet('远程ip'.'username','password')linux上测试,没有任何反应呢.请教是什么原因咯~~ 谢谢 拼接造成的数组问题 php网站 手机归属地查询接口 关于session无法取值的问题!!PHP 求教,关于随机生成的问题 奇怪的问题,关于php appserv 正则提取连接地址的问题 如何把字符串中类似,也就是以&#打头,后面跟着5位数字的字符串替换为空字符串? 遇到一个奇怪的问题,一直好好的,今天就突然发威了 100分问$_POST值成双倍了!!!,中间还有input控件名称 $_post的时候出问题了,$_post无效没有反应 MYSQL数据库进程的问题 讨论一下销售的统计
<?php
include('adodb.inc.php');include('tohtml.inc.php');
$database = 'mssql';
$db = ADONewConnection($database);
$db->debug = true;
$Global['debug'] = 1;
$host = '数据库服务器';$user = '用户名';$pwd = '密码';$database = '数据源';
$db->Connect($host, $user, $pwd,$database);
?>
用函数链接:
function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
{
$this->persistency = $persistency;
$this->user = $sqluser;
$this->password = $sqlpassword;
$this->server = $sqlserver;
$this->dbname = $database; $this->db_connect_id = ( $this->persistency ) ? mssql_pconnect($this->server, $this->user, $this->password) : mssql_connect($this->server, $this->user, $this->password); if( $this->db_connect_id && $this->dbname != "" )
{
if( !mssql_select_db($this->dbname, $this->db_connect_id) )
{
mssql_close($this->db_connect_id);
return false;
}
} return $this->db_connect_id;
}
我也是刚解决这个问题,一句话:freetds