Skip to content

Instantly share code, notes, and snippets.

@novalagung
Created October 30, 2012 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save novalagung/3979517 to your computer and use it in GitHub Desktop.
Save novalagung/3979517 to your computer and use it in GitHub Desktop.
$result = array();
foreach($sql as $key => $value){
$result[$key] = $this->db->query($value);
}
/** same with */
$result = array();
for ($i = 0; $i < count($sql); $i++) {
$key = $i;
$value = $sql[$i];
$result[$key] = $this->db->query($value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment