Hi all,
I want to echo the current db value in a html select box, and show other selections from another table also, so the admin can change the value if required.
I have 2 tables - one contains all the client data, the other contains the areas.
CLIENT TABLE:
----------------------
|clientID|client|area|
----------------------
| 39|swaugh| nth|
| 40|billyg| sth|
----------------------
AREAS TABLE:
-----------------
| areaID| area|
-----------------
| 1| nth|
| 2| sth|
| 3| wst|
| 4| est|
-----------------
The code below will echo all the area values to the select box, but I want to echo the current value from the CLIENT table into the select box AND all the values from the AREAS table as well.
Any help or direction appreciated!PHP Code:<select name="area">
<?
$sql=mysql_query("SELECT * FROM areas");
while ($row = mysql_fetch_object($sql)) {
echo "<option value= \" $row->area\">$row->area</option>" ;
}
?>
</select>
Mike





Have a problem though...
Bookmarks