Skip to content

Instantly share code, notes, and snippets.

@radmiraal
Created August 7, 2012 11:45
Show Gist options
  • Save radmiraal/3284750 to your computer and use it in GitHub Desktop.
Save radmiraal/3284750 to your computer and use it in GitHub Desktop.
function exec_SELECTgetRows($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '', $uidIndexField = '') {
$res = $this->exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);
if ($this->debugOutput) {
$this->debug('exec_SELECTquery');
}
if (!$this->sql_error()) {
$output = array();
if ($uidIndexField) {
while ($tempRow = $this->sql_fetch_assoc($res)) {
$output[$tempRow[$uidIndexField]] = $tempRow;
}
} else {
while ($output[] = $this->sql_fetch_assoc($res)) {
;
}
array_pop($output);
}
$this->sql_free_result($res);
}
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment