1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Where is my damn 1064 error ?

Discussion in 'Databases' started by schlogo, Aug 14, 2014.

  1. #1
    Hello

    I have a function that gives me a 1064 error :
    SEMrush
    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 !
     
    Solved! View solution.
    schlogo, Aug 14, 2014 IP
    SEMrush
  2. schlogo

    schlogo Well-Known Member

    Messages:
    1,615
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    140
    #2
    Anyone ? an idea ?
     
    schlogo, Aug 14, 2014 IP
  3. #3
    Change
    $query = "SELECT * FROM #__locplantes_offices WHERE fk_site_id = " .$site;

    To
    $query = "SELECT * FROM #__locplantes_offices WHERE fk_site_id = ' . $site . '";
     
    GORF, Aug 14, 2014 IP
    schlogo likes this.
  4. schlogo

    schlogo Well-Known Member

    Messages:
    1,615
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    140
    #4
    Hello GORF, tks for your answer, it works
     
    schlogo, Aug 28, 2014 IP