Jump to content

dropdown default value by sql query


dajesterofdeath

Recommended Posts

Hi Guys, I have this as a dropdown list. It gets the values from a table.

<?php print "<select name=\"newcompany\">\n";	 while ($rowb = mysql_fetch_assoc($resulta)){	 $id = $rowb['id'];	 $companya = $rowb['company'];	 print "<option value=$companya>$companya\n";	 }print "</select>\n";?>

What i need to do is set its default option to be that of the account i am querying eg. customer details Homer Simpson 742 Evergreen Terrace Springfield PowerPlant The table for companies might beKwikemartPowerPlantSchool When i display the account i want the dropdown to default to the value in sql for that person. Cheers

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...