59 if ( !function_exists(
'mysqli_init' ) ) {
61 "MySQLi functions missing, have you compiled PHP with the --with-mysqli option?"
75 $hostAndPort = IP::splitHostAndPort( $realServer );
77 $realServer = $hostAndPort[0];
78 if ( $hostAndPort[1] ) {
79 $port = $hostAndPort[1];
81 } elseif ( substr_count( $realServer,
':/' ) == 1 ) {
84 list( $realServer, $socket ) = explode(
':', $realServer, 2 );
87 $mysqli = mysqli_init();
91 $connFlags = MYSQLI_CLIENT_FOUND_ROWS;
92 if ( $this->
getFlag( self::DBO_SSL ) ) {
93 $connFlags |= MYSQLI_CLIENT_SSL;
102 if ( $this->
getFlag( self::DBO_COMPRESS ) ) {
103 $connFlags |= MYSQLI_CLIENT_COMPRESS;
105 if ( $this->
getFlag( self::DBO_PERSISTENT ) ) {
106 $realServer =
'p:' . $realServer;
109 if ( $this->utf8Mode ) {
112 $mysqli->options( MYSQLI_SET_CHARSET_NAME,
'utf8' );
114 $mysqli->options( MYSQLI_SET_CHARSET_NAME,
'binary' );
116 $mysqli->options( MYSQLI_OPT_CONNECT_TIMEOUT, 3 );
118 if ( $mysqli->real_connect(
229 $field =
$res->fetch_field_direct( $n );
233 $field->not_null = $field->flags & MYSQLI_NOT_NULL_FLAG;
234 $field->primary_key = $field->flags & MYSQLI_PRI_KEY_FLAG;
235 $field->unique_key = $field->flags & MYSQLI_UNIQUE_KEY_FLAG;
236 $field->multiple_key = $field->flags & MYSQLI_MULTIPLE_KEY_FLAG;
237 $field->binary = $field->flags & MYSQLI_BINARY_FLAG;
238 $field->numeric = $field->flags & MYSQLI_NUM_FLAG;
239 $field->blob = $field->flags & MYSQLI_BLOB_FLAG;
240 $field->unsigned = $field->flags & MYSQLI_UNSIGNED_FLAG;
241 $field->zerofill = $field->flags & MYSQLI_ZEROFILL_FLAG;