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

php 与access 数据库连接实例

WBOY
WBOYOriginal
2016-06-08 17:27:581081browse
<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
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