I received some help moments ago, but was never able to find out why this query is not working? How might I modify this to make it work?
class Posts {
public static function multipleQuery() {
$result = mysql_query("SELECT * FROM posts ORDER BY id DESC LIMIT 0, 3")
, __CLASS__);
while($object = mysql_fetch_object($result)) {
$return[] = $object;
}
return $return;
}
}
$array = Posts::multipleQuery();
foreach($array AS $row) {
echo $row->title;
}
Unfortunately I am not getting anything back. The query works, I have tested that out.
var_dump($array). Also, __CLASS__)is misplaced. Please be more specific on what exactly doesn't work.), __CLASS__);ini_set('error_reporting', E_ALL);andini_set('display_errors', true);set at the top of your script will ensure that errors are displayed and should help you to debug this., __CLASS__).