Hi
I have created a web page that has two (for now) forms, each connected to different multi-record table. The problem is, no matter what I do, the second form always displays the top record and nothing else.
This is the top code:
<?php include 'common/includes/php_header.inc'; ?>
<?php
// load record from 'history_overview'
list($history_overviewRecords, $history_overviewMetaData) = getRecords(array(
'tableName' => 'history_overview',
'where' => '', // load first record
'loadUploads' => true,
'allowSearch' => false,
'limit' => '1',
));
$history_overviewRecord = @$history_overviewRecords[0]; // get first record
if (!$history_overviewRecord) { dieWith404("Record not found!"); } // show error message if no record found
// load list records from 'historical_notes'
list($historical_notesRecords, $historical_notesMetaData) = getRecords(array(
'tableName' => 'historical_notes',
'loadUploads' => true,
'allowSearch' => false,
));
// load records from 'awards_trophies'
list($awards_trophiesRecords, $awards_trophiesMetaData) = getRecords(array(
'tableName' => 'awards_trophies',
'loadUploads' => true,
'allowSearch' => false,
));
?>
These are the 2 forms:
<table>
<tr>
<td>
<form method="get" action="historyNotes.php?">
<h2>Select a year in history:</h2>
<select name="year">
<option value="">--</option>
<?php foreach ($historical_notesRecords as $listRecord): ?>
<option value="<?php echo htmlencode($listRecord['num']); ?>" <?php selectedIf($listRecord['num'], @$_REQUEST['year']); ?>>
<?php echo htmlencode($listRecord['title']); ?>
</option>
<?php endforeach; ?>
</select>
<br>
<input type="submit" value="Submit">
</form>
</td>
<td>
<form method="get" action="historyAwards.php?">
<h2>Select an award:</h2>
<select name="title">
<option value="">--</option>
<?php foreach ($awards_trophiesRecords as $awardRecord): ?>
<option value="<?php echo htmlencode($awardRecord['num']); ?>" <?php selectedIf($awardRecord['num'], @$_REQUEST['award']); ?>>
<?php echo htmlencode($awardRecord['title']); ?>
</option>
<?php endforeach; ?>
</select>
<br>
<input type="submit" value="Submit">
</form>
</td>
</tr>
</table>
Any ideas would be greatly appreciated!
Ragi
--
northernpenguin
Northern Penguin Technologies
"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke