PHP connects to the access database and phpaccess database. PHP connects to the access Database. the phpaccess database uses the PingSwitch to create a front-end for WEB display because the structure of Delphi and access is used at the beginning, the connection between Delphi and MySQL is PHP connected to the access database and the phpaccess database.
Because the previous PingSwitch is used as a front-end for WEB display, the Delphi and access structures are used at the beginning, and the connection between Delphi and MySQL is relatively troublesome, at last, I can only choose a combination of PHP + Access, which is strange but reasonable ·····
To connect to the access database in PHP, we must connect to ADO, which is very similar to connecting to the database in ASP. A demo is provided below for your reference.
<? PHP/* Create An ADO Connection */$ conn = @ new COM ("ADODB. connection ") or die (" ADO Connection faild. "); $ connstr =" DRIVER = {Microsoft Access Driver (*. mdb)}; DBQ = ". realpath ("DATUM/cnbt. mdb "); $ conn-> Open ($ connstr);/* create a record set query */$ rs = @ new COM (" ADODB. recordSet "); $ rs-> Open (" select * from dbo_dirs ", $ conn, 1, 3);/* read data cyclically */while (! $ Rs-> eof) {echo "$ rs-> Fields [" title "]-> Value; echo"
"; $ Rs-> Movenext (); // move the record set pointer Down} $ rs-> close ();?>
In this way, it will be okay ····
The above is all the content of this article. I hope you will like it.
Because the previous PingSwitch is used to make a front-end of WEB display, the Delphi and access structure is used at the beginning, and the connection between Delphi and MySQL is...