免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1115 | 回复: 0
打印 上一主题 下一主题

有人搭建过win下php+sybase+pear:db的平台吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-10-11 17:10 |只看该作者 |倒序浏览
折腾了一下午解决不了
现在情况是:
sybase-CT已经安装好了(装了sybase客户端)
pear:DB也工作正常(链接本地mysql没问题)
但是用pear链接sybase就是连不上 
DB Error: connect failed
以下是源程序

<?php
  // The pear base directory must be in your include_path
  require_once 'DB.php';
  $user = 'xxx';
  $pass = 'xxx';
  $host = 'xxx:xxx';
  $db_name = 'xxx';
  
  // Data Source Name: This is the universal connection string
  $dsn = "sybase://$user:$pass@$host/$db_name";
  
  // DB::connect will return a Pear DB object on success
  // or a Pear DB Error object on error
  // You can also set to TRUE the second param
  // if you want a persistent connection:
  // $db = DB::connect($dsn, true);
  $db = DB::connect($dsn);
  
  // With DB::isError you can differentiate between an error or
  // a valid connection.
  if (DB::isError($db)) {
          die ($db->;getMessage());
  }
  // You can disconnect from the database with:
  $db->;disconnect();
  ?>;
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP