Question : Show selected item in select form.

I have this code below which gets results from a table and puts them in a select html form.

This works great.

but in this select form I need the initially selected value of the select form to be client id which is generated here.

$query = "SELECT * FROM projects , client , zone WHERE projects.clientid =  client.clientid AND projects.zoneid =  zone.zoneid";
$result = mysql_query($query) or die ("Couldn't execute query.");

e.g "' . $row['clientid'] . '"

Any ideas would be great.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
<?php
$query = "SELECT * FROM projects , client , zone WHERE projects.clientid =  client.clientid AND projects.zoneid =  zone.zoneid";
$result = mysql_query($query) or die ("Couldn't execute query.");

while ($row = mysql_fetch_assoc($result))
{
    echo '<tr>';
	
	echo '<td>';
	
    echo '<form action="send_email.php" method="post">';
    echo '<input name="projectid" type="hidden" value="' . $row['projectid'] . '" size="3" />';

$get = "SELECT clientid,company FROM client ORDER BY company ASC";
		// prepares the information //
		$answer = mysql_query($get)
		// Kills process if the information cant be extracted //
    	or die ("Couldn't execute query."); 
		
		
		echo "<select name='clientid' class='gradientform'>\n";
			while ($info = mysql_fetch_array($answer))
  			{
    		extract($info);
   				echo "	<option value='$clientid'>$company\n";
  			}
  				echo "	</select>\n";
    
	
	echo '<input name="company"   type="text" value="' . $row['company']   . '" size="22" />';
	echo '<input name="project"   type="text" value="' . $row['project']   . '" size="22" />';
	
    echo '<input name="button"    type="submit" id="button" value="Submit" />';
    echo '</form>';
    echo '</td>';
    echo '</tr>';
}

?>

Answer : Show selected item in select form.

select concat(year(YourDate), '-',Month(YourDate)) from table
Random Solutions  
 
programming4us programming4us