AnsweredAssumed Answered

List of Records using PHP button to select just one

Question asked by fredrogers on Jun 27, 2012
Latest reply on Jun 27, 2012 by fredrogers

Hello! First, thank you for reading this.



I am just starting php and I am tying to make a site using FileMaker to display and enter information.

I have the php connecting to my database, then a search page using a form, then it displays a list of records. I would like to make a "button" that will select one record then display related records.

This is where my trouble is. I do not know how to make a form that will save either the record_Id or key field to then display the next page.

I am using a foreach loop to display the list in a table:



$records = $result->getRecords();

echo '<table border="1">';

echo '<tr>';

echo '<th>Company</th>';

echo '<th>Id Num</th>';

echo '<th>Choose</th>';

echo '</tr>';

foreach ($records as $record) {

  echo '<tr>';

  echo '<td>'.$record->getField('Company').'</td>';

  echo '<td>'.$record->getField('K_Medical').'</td>';

  echo '<td>

<form action="welcome.php" method="post">

#This is where I think I need the button, but instead it just breaks

<input type="hidden" name="med_id[]" value='$record->getField('K_Medical')/>';

<input type="submit" />


echo '</form></td>';

  echo '</tr>';


echo '</table>';



As you can see I have tried to use a hidden form field to get the key field of the record, but the page dose not work. I get an error 500 when I try to view it in a browser.


Any help would be greatly appreciated! If I have not provided enough information please let me know.