Hi this is my first post on this forum and im hoping i can get help with the code below, well here it goes.
I have a database where you can select the status of a driver by using a dynamic drop down menu and then post it to the DB, what i want to do is when i am updating the driver status that it pulls the records for that driver and in the drop down menu it selects the value that the driver, can anyone help me with this or if you dont fully understand please ask me to elaborate. Any help would be great.
<?php
$result = mysql_query("SELECT * FROM digi WHERE id='$_GET[id]'");
while($row = mysql_fetch_array($result))
{ $activity = $row['active'];
echo "<form action='update2.php' method='post'>
<table border='0' align='center' text='red'>
<tr>
<td>
Status:
</td>
<td>
<select name='active' style='width:200'>
";
}
$query1 = "SELECT * from driverstate ORDER BY list ASC";
$result1=@mysql_query($query1);
while ($row1 = @mysql_fetch_array($result1))
print
'<option value="' . $row1['id'] . '">' . $row1['list'] . '</option>';
;
?>
I have tried using the following:
print '<option value="' . $row1['id'] . '" selected="$activity">' . $row1['list'] . '</option>';
;