Skip to content

Instantly share code, notes, and snippets.

@tubbo
Created June 8, 2011 21:26
Show Gist options
  • Save tubbo/1015448 to your computer and use it in GitHub Desktop.
Save tubbo/1015448 to your computer and use it in GitHub Desktop.
<?php
function query_single($sql) {
$return = array();
$query = mysql_query($sql, $this->connection);
var_dump($query);
while ($row = mysql_fetch_assoc($query)) {
$return[] = $row;
}
// Free resultset
mysql_free_result($query);
return $return[0];
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment