无为清净楼资源网 Design By www.qnjia.com
1.Com链接,ADODB.Connection

复制代码 代码如下:
$conn = new Com("ADODB.Connection"); //实例化一个Connection对象
$connstr = "provider=sqloledb;datasource=.;uid=sa;pwd=123456;database=jnold;";
$conn->Open($connstr);
$rs = new Com("ADODB.Recordset"); //实例化一个Recordcount对象

$rs->Open('select * from News where bigclassid = 59 And LeadPostil is null', $conn, 1, 1);
$count = $rs->RecordCount;
echo "共有{$count}条纪录<br />";
for($i = 0; $i < $count ; $i++){

$arr_result[$i]['Title'] = addslashes($rs->Fields('Title')->Value);//标题
$arr_result[$i]['Color'] = addslashes($rs->Fields('titlecolor')->Value?$rs->Fields('titlecolor')->Value:");//标题颜色
$arr_result[$i]['WenHao'] = addslashes($rs->Fields('OtherText')->Value);//文号

}


2.ODBC连接mssql

复制代码 代码如下:
$dbhost = ";
$dbuser = "; //你的mssql用户名
$dbpass = "; //你的mssql密码
$dbname = "; //你的mssql库名

$connect=odbc_connect("Driver={SQL Server};Server=$dbhost;Database=$dbname","$dbuser","$dbpass");
$sql="select * from content";
$exec=odbc_exec($connect,$sql);
while($row = (odbc_fetch_array($exec)))
{
$row['id'] //?取字段值

}
标签:
php,sqlserver2000

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com