Hi
I'm hoping someone here can help me with a php/mysql question :-)
I have a dropdown menu populated from a table "tblsyslur". The fields in "tblsyslur" are:
sysla
syslaskt
syslaid = primary key
I have taken the values from the field "sysla" and used that to populate a dopdown menu. What I want to do is to is, when a value is selected in the dropdown menu, the "syslaid" is registred and used to lookup values in another table (tblhreppar) (that also has syslaid in it) and then a list of values from the tblhreppar is displayed below the dropdown menu.
Here is the code I've used to generate the dropdown menu.
<?php
require_once 'login.php';
$db_server = mysql_connect($db_hostname, $db_username, $db_password);
if (!$db_server) die("Unable to connect to MySQL: " . mysql_error());
mysql_select_db($db_database, $db_server)
or die("Unable to select database: " . mysql_error());
$results=mysql_query("SELECT * FROM tblsyslur") or die(mysql_error());
echo "<select name=myselect>";
while($row=mysql_fetch_assoc($results)) {
echo "<option value=$row[syslaid]>$row[sysla]</a></option>";
}
echo "</select>";
?>