usingcomwithphp (I will not translate) _php tutorial

Source: Internet
Author: User
Using COM with PHP
by John Lim.
PHP4 on Windows have been extended to support Microsoft ' s COM technology. However documentation on the COM functions are very sparse at the moment.
Here is some examples of stuff I have tried. Hope This gives you some ideas. Note that these is running PHP on a Windows Web server.
Active Data Objects (ADO) with PHP
ADO is Microsoft's database object technology. There is objects for connecting to databases, recordsets for data returned from queries, and Field objects representing D ATA elements.
Most databases don't support ADO directly. Instead most databases support 2 lower level Microsoft database Technologies:odbc and OLE DB. more databases support ODBC; But OLE DB has a reputation of being faster than ODBC.
ADO is then an API wrapper around ODBC and OLE DB.
This example opens a new ADO Connection object, opens the traditional NorthWind ms-access database via ODBC. When we execute the SQL, a-RecordSet object is returned. We then display the first 3 fields of the Record-set.
$DBC = new COM ("ADODB. Connection ");
$dbc->provider = "MSDASQL";
$dbc->open ("Nwind");
$rs = $dbc->execute ("SELECT * FROM Products");
$i = 0;
$FLD 0 = $rs->fields (0);
$FLD 1 = $rs->fields (1);
$FLD 2 = $rs->fields (2);
while (! $rs->eof) {
$i + = 1;
Print "$fld 0->value $fld 1->value $fld 2->value
";
$rs->movenext (); /*updates fld0, Fld1, Fld2!*/
}

http://www.bkjia.com/PHPjc/629286.html www.bkjia.com true http://www.bkjia.com/PHPjc/629286.html techarticle Using com with PHP by John Lim. PHP4 on Windows have been extended to support Microsoft ' s COM technology. However documentation on the COM functions are very sparse at the moment. Her ...

  • 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.