通過ODBC連接的SQL SERVER實例
更新時間:2006年10月09日 00:00:00 作者:
通過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);
?>
<?
$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);
?>
您可能感興趣的文章:
相關(guān)文章
php array_push()數(shù)組函數(shù):將一個或多個單元壓入數(shù)組的末尾(入棧)
函數(shù)array_push():將一個或多個單元壓入數(shù)組的末尾(入棧)2011-07-07
PHP數(shù)組中頭部和尾部添加元素的方法(array_unshift,array_push)
對于數(shù)字索引數(shù)組來說,通過 array_push()函數(shù)向數(shù)組中尾部添加元素,array_unshift頭部添加元素,需要的朋友可以參考下2017-04-04
PHP編程最快明白(第一講 軟件環(huán)境和準備工作)
PHP我使用的是ESSamp集成開發(fā)環(huán)境,版本PHP5以上,代碼經(jīng)windowsXP系統(tǒng)調(diào)試通過。2010-10-10

