摘要:本文实例讲述了PHP使用ODBC连接数据库的方法。分享给大家供大家参考。具体实现方法如下:html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&
本文实例讲述了PHP使用ODBC连接数据库的方法。分享给大家供大家参考。具体实现方法如下:html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
PHP and ODBC: XHTML Example 1"username", "password");
if (!($conn)) {
echo "
Connection to DB via ODBC failed: ";
echo odbc_errormsg ($conn );
echo "
\n"; } $sql = "SELECT 1 as test";$rs = odbc_exec($conn,$sql);
echo "
echo "
Test";while (odbc_fetch_row($rs)) {
$result = odbc_result($rs,"test");
echo "
$result";}
odbc_close($conn);
echo "
";?>
更多关于PHP使用ODBC连接数据库的方法请关注PHP中文网(www.php.cn)其他文章!