Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate Combo from Database and Dynamic Link

Status
Not open for further replies.

34534534534555

IS-IT--Management
Joined
Jan 8, 2003
Messages
240
Location
GB
Hello,

Is it possible to populate a combo box from a column in a mySQL database? then run a query based on the item selected?

Also when the end results are returned, which will be a list of items, i want to create a link to .php page for each item, so that i can manipulate it,.

Thanks in Advance


| Feedback is always appreciated as this will help to further our knowledge as well |
 
could you please point me in the right direction for some code, or better a tutorial on doing this? I have searched google and not come up with anything for my first request.

I had something on the second one , but i have lost it.

Thanks


| Feedback is always appreciated as this will help to further our knowledge as well |
 
if you specify what you mean with combo, a select list or an checkbox ???

here is an example of a select list

Code:
$query="SELECT botid,botdescr FROM bottlertable ORDER BY botdescr";
$rsbot=mysql_query($query,$conn);

<TR><TD><P>Bottler</P></TD><TD><select name=&quot;whbotid&quot;><option value=&quot;&quot;>Empty
<? 
$i=0;
$list = mysql_num_rows($rsbot); 
while($i < $list)	{
$row = mysql_fetch_array($rsbot); 
$botid=$row[&quot;botid&quot;];
$botdescr=$row[&quot;botdescr&quot;];

   echo &quot;<option value='$botid'>$botdescr&quot;;
$i++;
}
?>

</select></TD><td></td></TR>

for the rest you can deping on what you selected use the submitted variable in a condition



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top