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" );
65 $realServer = $hostAndPort[0];
66 if ( $hostAndPort[1] ) {
67 $port = $hostAndPort[1];
72 if ( $this->mFlags &
DBO_SSL ) {
73 $connFlags |= MYSQLI_CLIENT_SSL;
76 $connFlags |= MYSQLI_CLIENT_COMPRESS;
79 $realServer =
'p:' . $realServer;
82 $mysqli = mysqli_init();
86 $mysqli->options( MYSQLI_SET_CHARSET_NAME,
'utf8' );
88 $mysqli->options( MYSQLI_SET_CHARSET_NAME,
'binary' );
92 for ( $i = 0; $i < $numAttempts; $i++ ) {
96 if ( $mysqli->real_connect( $realServer, $this->mUser,
97 $this->mPassword, $this->mDBname, $port,
null, $connFlags )
116 if ( method_exists( $this->mConn,
'set_charset' ) ) {
117 return $this->mConn->set_charset( $charset );
119 return $this->
query(
'SET NAMES ' . $charset, __METHOD__ );
127 return $this->mConn->close();
134 return $this->mConn->insert_id;
141 if ( $this->mConn ) {
142 return $this->mConn->errno;
144 return mysqli_connect_errno();
152 return $this->mConn->affected_rows;
160 $this->mDBname = $db;
162 return $this->mConn->select_db( $db );
169 return $this->mConn->server_info;
187 $object =
$res->fetch_object();
188 if ( $object ===
null ) {
200 $array =
$res->fetch_array();
201 if ( $array ===
null ) {
213 return $res->num_rows;
221 return $res->field_count;
230 $field =
$res->fetch_field_direct(
$n );
231 $field->not_null = $field->flags & MYSQLI_NOT_NULL_FLAG;
232 $field->primary_key = $field->flags & MYSQLI_PRI_KEY_FLAG;
233 $field->unique_key = $field->flags & MYSQLI_UNIQUE_KEY_FLAG;
234 $field->multiple_key = $field->flags & MYSQLI_MULTIPLE_KEY_FLAG;
235 $field->binary = $field->flags & MYSQLI_BINARY_FLAG;
246 $field =
$res->fetch_field_direct(
$n );
257 $field =
$res->fetch_field_direct(
$n );
268 return $res->data_seek( $row );
276 if ( $conn ===
null ) {
277 return mysqli_connect_error();
289 return $this->mConn->real_escape_string(
$s );
293 return $this->mConn->ping();
302 if ( $this->mConn instanceof Mysqli ) {
303 return (
string)$this->mConn->thread_id;