Skip to content

Instantly share code, notes, and snippets.

@Motoma
Created March 9, 2011 14:35
Show Gist options
  • Save Motoma/862281 to your computer and use it in GitHub Desktop.
Save Motoma/862281 to your computer and use it in GitHub Desktop.
function query($qry)
{
if(!isset($this->database_link)) $this->connect();
$result = mysql_query($qry, $this->database_link) or die("Error: ". mysql_error());
$returnArray = array();
$i=0;
while ($row = mysql_fetch_array($result, MYSQL_BOTH))
if ($row)
$returnArray[$i++]=$row;
mysql_free_result($result);
return $returnArray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment