SELECT G.* , COUNT(M.id) AS nbr_media, M.media FROM ka_galleries G LEFT JOIN ka_galleries_pos GP ON GP.gallery_id = G.id LEFT JOIN ka_gallery_media M ON M.gallery_id = G.id WHERE GP.pos_id = AND G.expo = 0 AND G.actif = 1 GROUP BY G.id ORDER BY GP.ordre ASC, G.id, M.idYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND G.expo = 0 AND G.actif = 1 GROUP BY G.id ORDER BY GP.ordre ...' at line 6
Fatal error: Uncaught Error: Call to a member function fetch_assoc() on null in /var/www/clients/client1/web1/web/includes/fct_swql.php:47 Stack trace: #0 /var/www/clients/client1/web1/web/includes/fct_gallery.php(23): swql_fetch_assoc('SELECT G.* , CO...') #1 /var/www/clients/client1/web1/web/pages/pos.php(52): get_pos_galleries(NULL) #2 /var/www/clients/client1/web1/web/index.php(24): require('/var/www/client...') #3 {main} thrown in /var/www/clients/client1/web1/web/includes/fct_swql.php on line 47