PHP configuration, link to access database

Source: Internet
Author: User
First Download php-5.1.1-installer.exe more than 2 m, click it, okok, and then run it, go to disk D, all the way, click next. Create a directory named php and add the info. php file to the code: htmlbody? Phpinfo ();? /Bodyhtml data in iis

First DownloadPhp-5.1.1-installer.exe

More than 2 m, click it, and click OK. run the command and go to disk D. click next. Create a directory named php and add the info. php file to the code:





Data in iis: http: // localhost/php/info. php
If a long string of PHP Version 5.1.1 is displayed, congratulations. the configuration is complete.

Create php/data/db. mdb, create the table szd_t, and input data,

Create the file default. php; input:

$ 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, and print the record you just logged in the database. it's successful. hahaha, it's finished.

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.