The only thing is, I would like to create a form that shows this php file/dropdown. I can 'include' the php file and it shows the actual drop down. But it also shows an empty dropdown, most likely (I guess) due to the html code.:
Code: Select all
<td>Series in English:
<select id="serie_id" name="series_english">
<?php include('php/DropdownSeries.php'); ?>
</select><br><br><br><br>
</td>
I posted the code for the dropdown, cause it might just be part of the problem:
Code: Select all
<?php
// Open DB
include("library/config.php");
include("library/opendb.php");
// Query the series table and load all of the records
// into an array.
$sql = 'SELECT series_english FROM series';
$res = mysql_query($sql) or die(mysql_error());
while ($rec = mysql_fetch_assoc($res)) $series[] = $rec;
// die('<pre>'.print_r($series));
echo '<SELECT name="dropdown">';
foreach ($series as $c)
{
if ($c['id'] == $_GET['id'])
echo "<OPTION value=\"{$c['id']}\" SELECTED>{$c['series_english']}</OPTION>\n";
else
echo "<OPTION value=\"{$c['id']}\">{$c['series_english']}</OPTION>\n";
}
echo '</SELECT>';
?>