3 Replies Latest reply on Dec 2, 2013 1:40 PM by LyndsayHowarth

    New FMS11 outputs only last-record data for all found records

    JoelShapiro

      Hi all

       

      This is a new one for me...

       

      A client recently put FMS11 onto a new machine and then moved over their DBs & websites from their old-but-working setup.

       

      Doing a query for a single record performs fine, but when there are multiple records returned from the query, the data from the last found record is repeated for each record, so if 20 records are returned, all 20 show the data of the last record.

       

      This is unique to this server, as the same page and same DB works fine in my dev environment, and had worked fine in their previous setup.

       

      When working, the output is:

      1) apple

      2) orange

      3) banana

       

      On this server, the output is:

      1) banana

      2) banana

      3) banana

       

      I see this when I output the full contents of the $records array, not just when I use a foreach loop.

       

      Has anyone else seen this before? Any thoughts?

       

      FMS11 11.0.5.510 / One-machine config / FMI-installed PHP (5.3.15)

      OS X 10.7.3 (I'll ask them to upgrade to 10.7.5, but don't think that's relevant)

       

      TIA,

      -Joel

        • 1. Re: New FMS11 outputs only last-record data for all found records
          LyndsayHowarth

          I've seen that where the wrong portal is used to display data from fields belonging to a different relationship... or visa versa.... which of course translates to the PHP $records...

           

          Perhaps there is a corruption on the layout being retrieved or a differnce in the PHP or FM API versions. I had a few weird things like that happen when I moved stuff from a 9x server to a 12x server (to be expected) and I had to change a few things for syntax... but you are not even changing versions.

           

          Can you post some specifics on the PHP code...?

           

          - Lyndsay

          • 2. Re: New FMS11 outputs only last-record data for all found records
            JoelShapiro

            Hi Lyndsay

             

            This is a simple direct query, no relationships or portals whatsoever.

             

            The code is:

            $find =& $fm->newFindCommand('layout');

            $find->addFindCriterion('fieldName', $val );

            $result = $find->execute();

             

            or even:

             

            $find =& $fm->newFindAllCommand('layout');

            $result = $find->execute();

             

            I'm thinking they may need to try reinstalling FMS.  (Don't know if they can just re-install the API)

             

            -Joel

             

            Lyndsay Howarth wrote:

             

            I've seen that where the wrong portal is used to display data from fields belonging to a different relationship... or visa versa.... which of course translates to the PHP $records...

             

            Perhaps there is a corruption on the layout being retrieved or a differnce in the PHP or FM API versions. I had a few weird things like that happen when I moved stuff from a 9x server to a 12x server (to be expected) and I had to change a few things for syntax... but you are not even changing versions.

             

            Can you post some specifics on the PHP code...?

             

            - Lyndsay

            • 3. Re: New FMS11 outputs only last-record data for all found records
              LyndsayHowarth

              So... What about retrieval from $result....

               

              I assume next comes foreach() .... Have you closed it correctly? Do you have all the repeating stuff between { and }

               

              Make sure if what gets inserted ... if in an include it is not in an include_once

               

              ... your code above looks fine so maybe now I need to see the next bit....

               

              - Lyndsay