Line 228... |
Line 228... |
228 |
if ( $sth = parent::query( $this->parameters['query'], MYSQLI_USE_RESULT ) ) {
|
228 |
if ( $sth = parent::query( $this->parameters['query'], MYSQLI_USE_RESULT ) ) {
|
229 |
if ( $sth === false ) {
|
229 |
if ( $sth === false ) {
|
230 |
$errors[] = array( 'id' => $this->errno, 'message' => $this->error );
|
230 |
$errors[] = array( 'id' => $this->errno, 'message' => $this->error );
|
231 |
} else {
|
231 |
} else {
|
232 |
// query can return either an array of array, array of hash, or both. Default is both
|
232 |
// query can return either an array of array, array of hash, or both. Default is both
|
233 |
$returnType = MYSQLI_BOTH;
|
233 |
//$returnType = MYSQLI_BOTH;
|
234 |
$this->parameters['columnMetaData'] = $sth->fetch_fields(); // get metadata
|
234 |
$this->parameters['columnMetaData'] = $sth->fetch_fields(); // get metadata
|
- |
|
235 |
// in newer PHP, this is an array of objects, so we turn it into an array of array
|
- |
|
236 |
foreach ( $this->parameters['columnMetaData'] as $index => $obj ) {
|
- |
|
237 |
if ( is_object($obj) ) {
|
- |
|
238 |
$this->parameters['columnMetaData'][$index] = (array) $obj;
|
- |
|
239 |
}
|
- |
|
240 |
}
|
235 |
$this->parameters['returnData'] = array(); // we'll put all the results in an array
|
241 |
$this->parameters['returnData'] = array(); // we'll put all the results in an array
|
236 |
// $fetchtype returns either an array of array, array of hash, or both. Default is both
|
242 |
// $fetchtype returns either an array of array, array of hash, or both. Default is both
|
237 |
switch ( $this->parameters['returnType'] ) {
|
243 |
switch ( $this->parameters['returnType'] ) {
|
238 |
case 'array':
|
244 |
case 'array':
|
239 |
$returnType = MYSQLI_NUM;
|
245 |
$returnType = MYSQLI_NUM;
|
Line 316... |
Line 322... |
316 |
$return[$row[0]] = $row[1];
|
322 |
$return[$row[0]] = $row[1];
|
317 |
}
|
323 |
}
|
318 |
return $return;
|
324 |
return $return;
|
319 |
}
|
325 |
}
|
320 |
|
326 |
|
321 |
|
- |
|
322 |
|
- |
|
323 |
/**
|
327 |
/**
|
324 |
* returns an array of the first column for each row returned from query
|
328 |
* returns an array of the first column for each row returned from query
|
325 |
*
|
329 |
*
|
326 |
* The query is run, then for each row returns, the first column
|
330 |
* The query is run, then for each row returns, the first column
|
327 |
* is added to $return (an array). $return is then returned.
|
331 |
* is added to $return (an array). $return is then returned.
|