Hello I have a function that gives me a 1064 error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SQL=SELECT * FROM c6diq_locplantes_offices WHERE fk_site_id = I know it s a syntax error but i don't see it :-/ Here s the code. Can someone point it ? function getOffices(){ $site = JRequest::getVar('site'); $query = "SELECT * FROM #__locplantes_offices WHERE fk_site_id = " .$site; $this->db->setQuery($query); $offices = $this->db->loadObjectList(); return $offices; } Code (markup): tks !
Change $query = "SELECT * FROM #__locplantes_offices WHERE fk_site_id = " .$site; To $query = "SELECT * FROM #__locplantes_offices WHERE fk_site_id = ' . $site . '";