1 Reply Latest reply on May 12, 2010 6:18 AM by cesc

    no rows in portal

    cesc

      Title

      no rows in portal

      Your post

      Hi, in CDML I used to check whether a portal had rows or was empty with [FMP-if:gennews::description.neq.]. This allowed me to write different HTML when my portal was empty.

       

      gennews: the relationship name

      description: a field in the related table that contained data in all existing records

       

      Can anyone help me on how to do something similar with FMS10 and PHP? I am rather new to this so excuse me if this is quite obvious.

       

      Thanks.

       

      cesc.

        • 1. Re: no rows in portal
          cesc

          I am trying different things, all partially unsuccessfull up to now. I just realized that if you have a relationship say 'gennews' and retrive the info through a portal:

           

          $gennews=$record->getRelatedSet('gennews');

           

          and then count the number of related records with count()

           

          $counter=count($gennews);

          echo($counter);

           

          if will give you the correct number of rows, except when there are NO related records and instead of returning 0, it counts 1!!

           

          What gives? Can anyone help? I am desperate by now!

           

          Using MacOS 10.6.3, FMS 10 and FMPro Advanced 10.0v3. I used to be quite