教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 UsingCOMwithPHP(我就不翻译了)

UsingCOMwithPHP(我就不翻译了)

发布时间:2016-10-27   编辑:jiaochengji.com
教程集为您提供UsingCOMwithPHP(我就不翻译了)等资源,欢迎您收藏本站,我们将为您提供最新的UsingCOMwithPHP(我就不翻译了)资源
Using COM with PHP
     By John Lim.
PHP4 on Windows has been extended to support Microsoft's COM technology. However documentation on the COM functions is very sparse at the moment.
Here are some examples of stuff I have tried. Hope this gives you some ideas. Note that these only work when you are running PHP on a Windows Web server.
Active Data Objects (ADO) with PHP
ADO is Microsoft's database object technology. There are objects for connecting to databases, recordsets for data returned from queries, and field objects representing data elements.
Most databases do not support ADO directly. Instead most databases support 2 lower level Microsoft database technologies: ODBC and OLEDB. More databases support ODBC; but OLEDB has a reputation of being faster than ODBC.
ADO is then an API wrapper around ODBC and OLEDB.
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;
    $fld0 = $rs->Fields(0);
    $fld1 = $rs->Fields(1);
    $fld2 = $rs->Fields(2);
    while (!$rs->EOF) {
        $i = 1;
        print "$fld0->value $fld1->value $fld2->value<BR>";
        $rs->MoveNext(); /*updates fld0, fld1, fld2 !*/
    }

您可能感兴趣的文章:
UsingCOMwithPHP(我就不翻译了)
uc浏览器电脑版翻译怎么设置
怎么使用谷歌浏览器翻译网页 谷歌浏览器翻译网页的教程
python解释器是什么
google谷歌浏览器无法翻译此网页内容怎么解决?
php有道翻译api调用方法
Highcharts教程 Highcharts翻译索引页
何谓回调?
opcode cache与JIT之间有哪些区别
看不懂pdf中的英文?就用Python

[关闭]
~ ~