当前位置: 首页 > 图文教程 > 网络编程 > PHP > 通过ODBC连接的SQL SERVER实例

PHP
在php中使用sockets:从新闻组中获取文章
用Zend Encode编写开发PHP程序
通过对服务器端特性的配置加强php的安全
Windows下PHP的任意文件执行漏洞
网站加速 PHP 缓冲的免费实现方法
最小化数据传输——在客户端存储数据
类的另类用法--数据的封装
GD输出汉字的函数的分析
自己动手做一个SQL解释器
php中文本数据翻页(留言本翻页)
web方式ftp
一个显示天气预报的程序
一个查看session内容的函数
如何把PHP转成EXE文件
提取HTML标签
输出控制类
搜索引擎技术核心揭密
通过ICQ网关发送手机短信的PHP源程序
一个ORACLE分页程序,挺实用的.
PHP中GET变量的使用

PHP 中的 通过ODBC连接的SQL SERVER实例


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 92 ::
收藏到网摘: n/a

通过ODBC连接的SQL SERVER实例一
<?
$connection = odbc_connect("mydata","userid","passwd");
$query = "select * from tab_1 where no>0" ;
$result = odbc_do($connection,$query) ;
print "<table border='1' width='100%' id='tab1' cellPadding='1' cellSpacing='0' align='top' bordercolorlight='#008000' bordercolordark='#008000'>";
while(odbc_fetch_into($result,&$fields))
{
print "<tr>\n";
for ($i = 21; $i <= 31 ; $i ++) {
print "<td width='6%'><input style='BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; BORDER-BOTTOM: #ffffff 1px solid; COLOR: #000000; FONT-SIZE: 9pt' size='7' type='text' name=text$i value=$temp>";
}
}
print "</table>";
odbc_close($connection);
?>