Passing variables between pages
Posted: Sun Apr 13, 2008 1:10 am
Code: Select all
<?php
$type_set = @mysql_query('SELECT id, type FROM types');
if (!$type_set) {
exit('<p>Error performing query: ' . mysql_error() . '</p>');
}
while ($row = mysql_fetch_array($type_set)) {
echo "<option value=\"{$row['id']}\">{$row['type']}</option>";
}
?>My page was working before when I only used HTML and listed each option separately with <a href> tags and writing each 'type' out at the end of the url. This variable is used in a query in the next url page. I thought creating a drop-down list with a submit button would take up less room and look nicer. Can it be done?