//Show current gigs or gig archive and display appropriate link if(isset($_GET['c']) && $_GET['c'] == "a"){ $date_range = "WHERE `emjazz_projects`.`project_active`='0'"; $archive_link = "  Current Projects"; $page_title = "Project Archive"; $search_archive = ""; } else { $date_range = "WHERE `emjazz_projects`.`project_active`='1'"; $archive_link = "  Project Archive"; $page_title = "Projects"; } //DB Connect include("safe/conn.php"); //Search content if(isset($_GET['search']) && $_GET['search'] != ""){ $search = $_GET['search']; $search_query = "AND MATCH (`emjazz_projects`.`project_name`,`emjazz_projects`.`project_description`,`emjazz_projects`.`project_contacts`,`organisation_access`.`org_name`) AGAINST ('$search*' IN BOOLEAN MODE)"; } else { $search_query = ""; } //Page numbers code $stmt = $db->query("SELECT COUNT(`emjazz_projects`.`id`) FROM `emjazz_projects` LEFT JOIN `organisation_access` ON `organisation_access`.`id`=`emjazz_projects`.`organisation_id` LEFT JOIN `emjazz_gallery` ON `emjazz_gallery`.`projects_thumb_id`=`emjazz_projects`.`id` $date_range $search_query AND `emjazz_projects`.`organisation_id`='$organisation_number'"); $num_results = $stmt->fetchColumn(); include("includes/page_numbers_code.php"); ?> Projects -

Search

Showing to of projects

Fatal error: Uncaught Error: Call to a member function query() on null in /var/www/vhosts/emjazz.co.uk/ncjazz.co.uk/projects.php:115 Stack trace: #0 {main} thrown in /var/www/vhosts/emjazz.co.uk/ncjazz.co.uk/projects.php on line 115