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