2 Replies Latest reply on Jan 18, 2017 5:16 AM by johnny83

    Get sum of column using FM PHP Api

    johnny83

      I have a tablo as shown below.

      Untitled.png

       

      I can print 40 when using this sql query:

       

      SELECT SUM (People) FROM "Booking" WHERE TourDate = 3/01/2017

       

      I want to get sum of the column "People" using FM PHP Api. So far I have written this:

       

      include("filemaker.php"); 
      $date = "3/01/2017"; 
      $fm = new FileMaker('filename', 'hostname', 'admin','passw0rd');
      $findCommand = $fm->newFindCommand("Bookings"); 
      $findCommand->addFindCriterion("TourDate", $date); 
      $result = $findCommand->execute(); 
      $records = $result->getRecords(); 
      

       

      First time I am using FM PHP Api. I don't know how to proceed from here. I would appreciate any suggestion. Thanks.