Skip to content

Instantly share code, notes, and snippets.

@amacgregor
Created March 23, 2014 02:15
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 amacgregor/9717629 to your computer and use it in GitHub Desktop.
Save amacgregor/9717629 to your computer and use it in GitHub Desktop.
<?php
function dbfetch() {
$r = mysql_query('SELECT ... ');
if ($r === false || mysql_num_rows($r) ==0){
return null;
}
return new DBData(mysql_fetch_array($r));
}
function test() {
$data = dbfetch();
$data->someFunction();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment