: This article mainly introduces how to use ADO in PHP under Windows. if you are interested in PHP tutorials, refer to it. In this example, a connection is established, and the access database NorthWind is opened with ODBC (the example is provided when Access is installed ). After the SQL statement is executed, The RecordSet object is returned. The example shows the first three fields:
$ Dbc = new COM ("ADODB. Connection ");
$ Dbc-> PRovider = "MSDASQL ";
$ Dbc-> Open ("nwind ");
$ Rs = $ dbc-> Execute ("select * from products ");
$ I = 0;
While (! $ Rs-> EOF ){
$ I + = 1;
$ Fld0 = $ rs-> Fields (0 );
$ Fld1 = $ rs-> Fields (1 );
$ Fld2 = $ rs-> Fields (2 );
Print "$ fld0-> value $ fld1-> value $ fld2-> value
";
$ Rs-> MoveNext ();
}
$ Rs-> Close ();
?>
The above introduces the use of ADO in PHP under Windows, including some content, and hope to be helpful to friends who are interested in PHP tutorials.