Maybe try this:
public static function get_pilots_newscreenshot($pilot_id, $count) {
$query = "SELECT id, file_name, file_description, pilot_id, UNIX_TIMESTAMP(date_uploaded) AS date FROM ".TABLE_PREFIX."screenshots WHERE pilot_id='$pilot_id' AND file_approved='1' ORDER BY date_uploaded DESC LIMIT $count;";
return DB::get_results($query);
}
I added the
".TABLE_PREFIX."
In front of the table name which should allow it to pick up the data now