Home  >  Article  >  php教程  >  PHP連接ODBC的代碼

PHP連接ODBC的代碼

WBOY
WBOYOriginal
2016-06-13 10:33:071111browse

也不知道自已的IT路能走多長,以後也別技較一時的得失了,憑自已興趣,能學多少就學多少了....

這是個用PHP連接ODBC的例子(抄來的),ODBC還要設定一下,注意要選報系統DSN,同事說用ODBC性能不太好!管它呢....


 /*本例是用PHP4通过ODBC访问数据库操作的演示*/
?>




注册会员列表 - 通过ODBC访问数据库演示




注 册 会 员 列 表




 
   
   
   
   
   
   
   
 

 //连接到ODBC数据库
 $myconn=odbc_connect("phptest","sa","etc");
 $strSql="select * from reguser";
 /*执行查询*/
 $result=odbc_do($myconn,$strSql);
 //Boolean odbc_fetch_row(integer result,integer row)
 while(odbc_fetch_row($result))//通过循环读取数据内容
 {
?>
 
   
   
   
   
   
   
   
 

 }
 //关闭对数据库的连接
 odbc_close($myconn);
?>
ID 姓名 性别 年龄 联系电话 电子邮件 家庭住址


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn