PHP Configuration Link Access database

Source: Internet
Author: User
Tags file info access database

First download the PHP installation package, download the address: http://www.skycn.com/soft/516.html

Only 2M more, brush down, Okok, and then run, go to D plate bar, Bon voyage, click Next. Then build a directory PHP, new file info.php input code:

<body>
<? phpinfo(); ?>
</body>

Data http://localhost/php/info.php in IIS

If there is a long list of PHP Version 5.1.1 and so on, congratulations, configuration well.

As shown in figure:

New Php/database/db.mdb, Build table szd_t, enter point data, as shown in figure:

To create a file default.php; Enter:

<?php //读取mdb数据库例程
$conn = new com("ADODB.Connection");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("data/db.mdb");
$conn->Open($connstr);
$rs = new com("ADODB.RecordSet");
$rs->Open("select * from szd_t",$conn,1,1);
while(! $rs->eof) {
$f = $rs->Fields(1);
echo $f->value;
$rs->MoveNext();
}
?>

Browse, also print you just in the database record, successful success, Ha ha, finished. As shown in figure:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.