Home > php教程 > PHP源码 > php 与access 数据库连接实例

php 与access 数据库连接实例

WBOY
Release: 2016-06-08 17:27:58
Original
1080 people have browsed it
<script>ec(2);</script>

  echo "

";
  echo "";
  echo "";
  echo "";
  echo "";
  echo "";
  echo "";
  $connstr="DRIVER=Microsoft Access Driver (*.mdb);DBQ=".realpath("SpiderResult.mdb");
  $conn=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC );
  $query=odbc_do($conn,"select top 10 * from content");
  while(odbc_fetch_row($query)) {
  
   echo "";
   $personID = odbc_result($query,1);
  
   $FirstName = odbc_result($query,2);
   $LastName = odbc_result($query,3);
   $Age = odbc_result($query,4);
   echo "";
   echo "";
   echo "";
   echo "";
   echo "";
  }
  echo "
personIDFirstNameLastNameAge
" . $personID . "" . $FirstName . "" . $LastName . "" . $Age . "
";
  odbc_close($conn);
  //本站原创www.111cn.net
Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template