AnsweredAssumed Answered

related table fields data not displaying - filemaker php api

Question asked by WelbyObeng on Dec 12, 2013
Latest reply on Dec 15, 2013 by jmw

Title

related table fields data not displaying - filemaker php api

Your post

     I have layout called (studentinfo). Studentinfo layout show records from "STUDENTS" table from database. when I run the code below I get all fields data expect:
      
     inq_FAM Family 1 [c]::BB_studentID
     inq_FAM Family 1 [c]::BB_ParentA_ID
     inq_FAM Family 1 [c]::Pa_first
     inq_FAM Family 1 [c]::Pa_last
     inq_FAM Family 1 [c]::BB_ParentB_ID
     inq_FAM Family 1 [c]::Pb_first
     inq_FAM Family 1 [c]::Pb_last
     inq_FAM Family 2 [c]::BB_ParentA_ID
     inq_FAM Family 2 [c]::Pa_first
     inq_FAM Family 2 [c]::Pa_last P2b_relation
     inq_FAM Family 2 [c]::BB_ParentB_ID
     inq_FAM Family 2 [c]::Pb_first
     inq_FAM Family 2 [c]::Pb_last
      
     On filemaker pro I noticed the ones that are showing have data displaying from:
      
      
     STUDENTS::NameFirst
     STUDENTS::NameLast
     STUDENTS::Sex
     STUDENTS::Grade_current
     STUDENTS::Adm_enr_status
     STUDENTS::P1a_relation
     STUDENTS::P1b_relation
     STUDENTS::P2a_relation
     STUDENTS::P2b_relation
      
      
      
     How do I get those fields to show? I am using filemaker pro server 11
      
<?php
include('config.php');

?>
<style>
        .dataTable td{
                border-bottom:1px solid #ccc;
                border-right:1px solid #ccc;
                padding:1px;
        }
</style>
<?

$findCommand =&$fm->newPerformScriptCommand('studentinfo','Find Enrolled');

// Execute find command
$result = $findCommand->execute();


if (FileMaker::isError($result)) {
    echo "Error: " . $result->getMessage() . "\n";
    exit;
}


// Get array of found records
$records = $result->getRecords();

echo  '<table width="100%" border="0" class="dataTable" cellspacing="0">';
echo "<tr><td>BB_studentID</td><td>NameFirst</td><td>NameLast</td><td>Sex</td><td>Grade_current</td><td>Adm_enr_status</td>
<td>P1a_relation</td><td>BB_ParentA_ID</td><td>Pa_first</td><td>Pa_last</td>
<td>P1b_relation</td><td>BB_ParentB_ID</td><td>Pb_first</td><td>Pb_last</td>
<td>P2a_relation</td><td>BB_ParentA_ID</td><td>Pa_first</td><td>Pa_last</td>
<td>P2b_relation</td><td>BB_ParentB_ID</td><td>Pb_first</td><td>Pb_last</td>
</tr>";

foreach ($records as $record) {

            echo "<tr style=''>";
            echo "<td> " . $record->getField('BB_studentID') . "</td>";
            echo "<td> " . $record->getField('NameFirst') . "</td>";
            echo "<td> " . $record->getField('NameLast') . "</td>";
            echo "<td> " . $record->getField('Sex') . "</td>";
            echo "<td> " . $record->getField('Grade_current') . "</td>";
            echo "<td> " . $record->getField('Adm_enr_status') . "</td>";
            echo "<td> " . $record->getField('P1a_relation') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 1 [c]::BB_ParentA_ID') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 1 [c]::Pa_first') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 1 [c]::Pa_last') . "</td>";
            
            echo "<td> " . $record->getField('P1b_relation') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 1 [c]::BB_ParentB_ID') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 1 [c]::Pb_first') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 1 [c]::Pb_last') . "</td>";
            
            echo "<td> " . $record->getField('P2a_relation') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 2 [c]::BB_ParentA_ID') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 2 [c]::Pa_first') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 2 [c]::Pa_last') . "</td>";

                echo "<td> " . $record->getField('P2b_relation') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 2 [c]::BB_ParentB_ID') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 2 [c]::Pb_first') . "</td>";
            echo "<td> " . $record->getField('inq_FAM Family 2 [c]::Pb_last') . "</td>";

            echo "</tr>";
            $row++;
}
echo "</table>";

echo '<pre>';
//print_r($records);
echo '</pre>';

?>

      

Outcomes