Home >Backend Development >PHP Tutorial >php connect access database

php connect access database

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-25 09:09:041075browse
  1. $conn = new com("ADODB.Connection");
  2. $connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= ". realpath("data/db.mdb");
  3. $conn->Open($connstr);
  4. $rs = new com("ADODB.RecordSet");
  5. $rs->Open("select * from szd_t",$conn,1,1);
  6. while(! $rs->eof)
  7. $f = $rs->Fields(1);
  8. echo $f->value;
  9. $rs ->MoveNext();
  10. ?>
Copy code


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