通过ODBC连接的SQL SERVER实例
发布时间:2006-10-14 2:56:47   收集提供:gaoqian
通过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);
?>  
 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50