php8.5
Home/ Manual/ reference / mysql/ MySQL client constants

MySQL client constants

It is possible to specify additional client flags for the mysql_connect and mysql_pconnect functions. The following constants are defined: MySQL client constantsConstantDescriptionMYSQL_CLIENT_COMPRESSUse compression protocolMYSQL_CLIENT_IGNORE_SPACEAllow space after function namesMYSQL_CLIENT_INTERACTIVEAllow interactive_timeout seconds (instead of wait_timeout) of inactivity before closing the connection.MYSQL_CLIENT_SSLUse SSL encryption. This flag is only available with version 4.x of the MySQL client library or newer. Version 3.23.x is bundled both with PHP 4 and Windows binaries of PHP 5.

Predefined Constants Constants

It is possible to specify additional client flags for the mysql_connect() and mysql_pconnect() functions. The following constants are defined:

ConstantDescription
MYSQL_CLIENT_COMPRESSUse compression protocol
MYSQL_CLIENT_IGNORE_SPACEAllow space after function names
MYSQL_CLIENT_INTERACTIVEAllow interactive_timeout seconds (instead of wait_timeout) of inactivity before closing the connection.
MYSQL_CLIENT_SSLUse SSL encryption. This flag is only available with version 4.x of the MySQL client library or newer. Version 3.23.x is bundled both with PHP 4 and Windows binaries of PHP 5.

The function mysql_fetch_array() uses a constant for the different types of result arrays. The following constants are defined:

ConstantDescription
MYSQL_ASSOCColumns are returned into the array having the fieldname as the array index.
MYSQL_BOTHColumns are returned into the array having both a numerical index and the fieldname as the array index.
MYSQL_NUMColumns are returned into the array having a numerical index to the fields. This index starts with 0, the first field in the result.

Source: reference/mysql/constants.xml · from the official PHP manual (php/doc-en)