38 $ret = $this->mConn->query( $sql );
40 $ret = $this->mConn->query( $sql, MYSQLI_USE_RESULT );
54 # Otherwise we get a suppressed fatal error, which is very hard to track down
55 if ( !function_exists(
'mysqli_init' ) ) {
57 .
" have you compiled PHP with the --with-mysqli option?\n" );
67 $realServer = $hostAndPort[0];
68 if ( $hostAndPort[1] ) {
69 $port = $hostAndPort[1];
71 } elseif ( substr_count( $realServer,
':' ) == 1 ) {
74 $hostAndSocket = explode(
':', $realServer );
75 $realServer = $hostAndSocket[0];
76 $socket = $hostAndSocket[1];
80 if ( $this->mFlags &
DBO_SSL ) {
81 $connFlags |= MYSQLI_CLIENT_SSL;
84 $connFlags |= MYSQLI_CLIENT_COMPRESS;
87 $realServer =
'p:' . $realServer;
90 $mysqli = mysqli_init();
94 $mysqli->options( MYSQLI_SET_CHARSET_NAME,
'utf8' );
96 $mysqli->options( MYSQLI_SET_CHARSET_NAME,
'binary' );
100 for ( $i = 0; $i < $numAttempts; $i++ ) {
104 if ( $mysqli->real_connect( $realServer, $this->mUser,
105 $this->mPassword, $this->mDBname, $port, $socket, $connFlags )
124 if ( method_exists( $this->mConn,
'set_charset' ) ) {
125 return $this->mConn->set_charset( $charset );
127 return $this->
query(
'SET NAMES ' . $charset, __METHOD__ );
135 return $this->mConn->close();
142 return $this->mConn->insert_id;
149 if ( $this->mConn ) {
150 return $this->mConn->errno;
152 return mysqli_connect_errno();
160 return $this->mConn->affected_rows;
168 $this->mDBname = $db;
170 return $this->mConn->select_db( $db );
177 return $this->mConn->server_info;
195 $object =
$res->fetch_object();
196 if ( $object ===
null ) {
208 $array =
$res->fetch_array();
209 if ( $array ===
null ) {
221 return $res->num_rows;
229 return $res->field_count;
238 $field =
$res->fetch_field_direct(
$n );
239 $field->not_null = $field->flags & MYSQLI_NOT_NULL_FLAG;
240 $field->primary_key = $field->flags & MYSQLI_PRI_KEY_FLAG;
241 $field->unique_key = $field->flags & MYSQLI_UNIQUE_KEY_FLAG;
242 $field->multiple_key = $field->flags & MYSQLI_MULTIPLE_KEY_FLAG;
243 $field->binary = $field->flags & MYSQLI_BINARY_FLAG;
254 $field =
$res->fetch_field_direct(
$n );
265 $field =
$res->fetch_field_direct(
$n );
276 return $res->data_seek( $row );
284 if ( $conn ===
null ) {
285 return mysqli_connect_error();
297 return $this->mConn->real_escape_string(
$s );
301 return $this->mConn->ping();
310 if ( $this->mConn instanceof Mysqli ) {
311 return (
string)$this->mConn->thread_id;