Also do not know how long it road can go, and then other skills more than a temporary gain and loss, with their own interests, can learn how much more how much ....
This is an example of using PHP to connect ODBC (copied), ODBC also need to set up, note to Xuan System DSN, colleagues say that the performance of ODBC is not very good!
?
/* This example is a demo of using PHP4 to Access database operations through ODBC * *
?>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
<style type= "Text/css" >
<!--
input {font-size:9pt;}
a:link {text-decoration:underline; font-size:9pt;color:000059}
a:visited {text-decoration:underline; font-size:9pt;color:000059}
a:active {text-decoration:none; font-size:9pt}
A:hover
body,table {font-size:9pt}
Tr,td
-->
</style>
<title> Registered Members List-Access database demo via ODBC </title>
</HEAD>
<body alink= "#FF0000" link= "#000099" vlink= "#CC6600" topmargin= "8" leftmargin= "0" bgcolor= "#FFFFFF" >
<br><br><center><font color=green size=3><b> Registered member list </b></font></ Center>
<br>
<table cellspacing=0 bordercolordark= #FFFFFF width= "#000000" bordercolorlight= border=1 "center" cellpadding= "2" >
<tr bgcolor= "#6b8ba8" style= "COLOR:FFFFFF" >
<TD width= "5%" align= "center" valign= "Bottom" height= ">ID</td>"
<TD width= "10%" align= "center" valign= "Bottom" > Name </td>
<TD width= "5%" align= "center" valign= "bottom" > Sex </td>
<TD width= "5%" align= "center" valign= "Bottom" > Age </td>
<TD width= "20%" align= "center" valign= "Bottom" > Tel </td>
<TD width= "20%" align= "center" valign= "bottom" > Email </td>
<TD width= "20%" align= "center" valign= "Bottom" > Home address </td>
</tr>
?
Connecting to an ODBC database
$myconn =odbc_connect ("Phptest", "sa", "etc");
$STRSQL = "SELECT * from Reguser";
/* Execute Inquiry * *
$result =odbc_do ($myconn, $STRSQL);
Boolean odbc_fetch_row (integer result,integer row)
while (Odbc_fetch_row ($result))///Read data content by looping
{
?>
<tr>
<TD align= "center" height= "><?echo odbc_result" ($result, 1)?></td>
<TD align= "center" ><?echo Odbc_result ($result, 2)?></td>
<TD align= "center" ><?echo Odbc_result ($result, 3)?></td>
<TD align= "center" ><?echo Odbc_result ($result, 4)?></td>
<TD align= "center" ><?echo Odbc_result ($result, 5)?></td>
<TD align= "center" ><?echo Odbc_result ($result, 6)?></td>
<TD align= "center" ><?echo Odbc_result ($result, 7)?></td>
</tr>
?
}
To close a connection to a database
Odbc_close ($myconn);
?>
</table>
</BODY>
</HTML>