linux下装sybase的客户端,配置远程服务器,php用sybase的函数操作.

解决方案 »

  1.   

    用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;
    }
      

  2.   

    楼上的,人家是说在LIUNX下的
    我也是刚解决这个问题,一句话:freetds
      

  3.   

    wanbb(wanbb) 我装了freetds 但还是连不上咯 我用mssql_connet('远程ip'.'username','password')linux上测试,没有任何反应呢.请教是什么原因咯~~ 谢谢