LXXIII. MaxDB PHP ExtensionIntroducciónThe MaxDB PHP extension allows you to access the functionality provided by MaxDB 7.5.0 and above. More information about the MaxDB Database server can be found at http://www.mysql.com/products/maxdb/. The MaxDB PHP extension is compatible to the MySQL mysqli extension. There are only minor differences in the behaviour of some functions due to the differences of the underlying database servers, MaxDB and MySQL. The main differences to mysqli are in the following functions:
Documentation for MaxDB can be found at http://dev.mysql.com/doc/maxdb/. RequisitosIn order to have these functions available, you must compile PHP with MaxDB support. Additionally, you must have the MaxDB SQLDBC runtime library available to access the MaxDB server. Documentation for MaxDB SQLDBC can be found at http://dev.mysql.com/doc/maxdb/. Download the MaxDB SQLDBC package from http://dev.mysql.com/downloads/maxdb/clients.html. InstalaciónBy using the --with-maxdb[=DIR] configuration option you enable PHP to access MaxDB databases. [DIR] points to the directory that contains the installed MaxDB SQLDBC package. Windows users will need to enable php_maxdb.dll inside of php.ini. Configuración en tiempo de ejecuciónEl comportamiento de estas funciones está afectado por los valores definidos en php.ini.
Tabla 1. MaxDB Configuration Options
A continuación se presenta una corta explicación de las directivas de configuración.
Clases predefinidasmaxdbRepresents a connection between PHP and a MaxDB database. Constructor
Métodos
Propiedades
maxdb_stmtRepresents a prepared statement. Métodos
Propiedades
maxdb_resultRepresents the result set obtained from a query against the database. Métodos
Propiedades
Constantes predefinidasEstas constantes están definidas por esta extensión y estarán disponibles solamente cuando la extensión ha sido o bien compilada dentro de PHP o grabada dinámicamente en tiempo de ejecución. The following constants to use with maxdb_options() are defined. For further description of these constants see http://dev.mysql.com/doc/maxdb/. Tabla 2. MaxDB PHP client constants
The function maxdb_fetch_array() uses a constant for the different types of result arrays. The following constants are defined: Tabla 3. MaxDB fetch constants
EjemplosAll examples in the MaxDB PHP documentation use the HOTELDB demo database from MaxDB. More about this database can be found at http://dev.mysql.com/doc/maxdb/en/98/11b83fa6b33c17e10000000a114084/frameset.htm. To use the examples in the MaxDB PHP documentation, you have to load the tutorial data into your database. Then you have to set maxdb.default_db in php.ini to the database that contains the tutorial data. This simple example shows how to connect, execute a query, print resulting rows and disconnect from a MaxDB database. The following example shows how to bind variables to a SELECT INTO statement.
The following example shows how to use MaxDB database procedures.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||