We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25663 MODX Staff
    • 12,272 Posts
    I think it’s because of the non-escaped single-quotes in your query assignment to $rs:
    LEFT JOIN `tblimages` usepicim ON usepicim.use_pict = 'Y'
    WHERE breedFK = '87'
    LIMIT 0 , 1000';
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 4172
      • 5,888 Posts
      what is with:

      <?php
      $sql="SELECT sireim.filelocation AS sireim_filelocation,
      sireim.description AS sireim_desc,
      sireim.width AS sireim_width,
      sireim.height AS sireim_height,
      damim.filelocation AS damim_filelocation,
      damim.description AS damim_desc,
      damim.width AS damim_width,
      damim.height AS damim_height,
      tbreeding.dow,
      tbreeding.rd,
      tbreeding.no_male_puppies,
      tbreeding.no_female_puppies,
      tbreeding.male_available,
      tbreeding.female_available,
      sire.callname AS sire_callname,
      dam.callname AS dam_callname,
      sire.regname AS sire_regname,
      dam.regname AS dam_regname
      FROM `tblbreeding` tbreeding
      LEFT JOIN `tbldogs` sire ON sire.dog_id = tbreeding.sireFK
      LEFT JOIN `tbldogs` dam ON dam.dog_id = tbreeding.damFK
      LEFT JOIN `tblimages` sireim ON sireim.dogFK = sire.dog_id AND sireim.use_pict = 'Y'
      LEFT JOIN `tblimages` damim ON damim.dogFK = dam.dog_id AND damim.use_pict = 'Y'
      WHERE breedFK = '87'
      LIMIT 0 , 1000";
      $rs=$modx->db->query($sql);
      $resultArray = $modx->db->makeArray($rs);
      
      //var_dump($resultArray);//for debugging
      
      if (count($resultArray)>0){
          $output = '';
           foreach($resultArray as $item){
                 //print_r($item);//for debugging
                 $params['Sire_callname']=$item['sire_callname'];
                 $params['Dam_callname']=$item['dam_callname'];
                 $params['Sire_regname']=$item['sire_regname'];
                 $params['Dam_regname']=$item['dam_regname'];
                 $params['Whelping date']=$item['dow'];
                 $params['Release date']=$item['rd'];
                 $params['Num male']=$item['no_male_puppies'];
                 $params['Num female']=$item['no_female_puppies'];
                 $params['Available males']=$item['male_available'];
                 $params['Available females']=$item['female_available'];
                 $output.=$modx->parseChunk('Golden Litters', $params, '[+', '+]');	
           }	
      	
      }
      return $output;
      ?>
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 24969
        • 120 Posts
        grin Thank you Bruno17!!!! grin
          The important thing is not to stop questioning. Curiosity has its own reason for existing. One cannot help but be in awe when he contemplates the mysteries of eternity, of life, of the marvelous structure of reality. It is enough if one tries merely to comprehend a little of this mystery every day. Never lose a holy curiosity.

          -Albert Einstein (1879 - 1955)

          Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635