61 # Avoid suppressed fatal error, which is very hard to track down
62 if ( !function_exists(
'mysqli_init' ) ) {
64 .
" have you compiled PHP with the --with-mysqli option?\n" );
74 $realServer = $hostAndPort[0];
75 if ( $hostAndPort[1] ) {
76 $port = $hostAndPort[1];
78 } elseif ( substr_count( $realServer,
':' ) == 1 ) {
81 $hostAndSocket = explode(
':', $realServer );
82 $realServer = $hostAndSocket[0];
83 $socket = $hostAndSocket[1];
86 $mysqli = mysqli_init();
89 if ( $this->mFlags & self::DBO_SSL ) {
90 $connFlags |= MYSQLI_CLIENT_SSL;
99 if ( $this->mFlags & self::DBO_COMPRESS ) {
100 $connFlags |= MYSQLI_CLIENT_COMPRESS;
102 if ( $this->mFlags & self::DBO_PERSISTENT ) {
103 $realServer =
'p:' . $realServer;
106 if ( $this->utf8Mode ) {
109 $mysqli->options( MYSQLI_SET_CHARSET_NAME,
'utf8' );
111 $mysqli->options( MYSQLI_SET_CHARSET_NAME,
'binary' );
113 $mysqli->options( MYSQLI_OPT_CONNECT_TIMEOUT, 3 );
115 if ( $mysqli->real_connect( $realServer, $this->mUser,
116 $this->mPassword, $this->mDBname, $port, $socket, $connFlags )
251 $field =
$res->fetch_field_direct( $n );
255 $field->not_null = $field->flags & MYSQLI_NOT_NULL_FLAG;
256 $field->primary_key = $field->flags & MYSQLI_PRI_KEY_FLAG;
257 $field->unique_key = $field->flags & MYSQLI_UNIQUE_KEY_FLAG;
258 $field->multiple_key = $field->flags & MYSQLI_MULTIPLE_KEY_FLAG;
259 $field->binary = $field->flags & MYSQLI_BINARY_FLAG;
260 $field->numeric = $field->flags & MYSQLI_NUM_FLAG;
261 $field->blob = $field->flags & MYSQLI_BLOB_FLAG;
262 $field->unsigned = $field->flags & MYSQLI_UNSIGNED_FLAG;
263 $field->zerofill = $field->flags & MYSQLI_ZEROFILL_FLAG;