Hello everyone. I'm a new member here at DaniWeb, but have learned a lot about PHP from these forums in the past.

I'm pretty new to PHP and am having a problem with meeting a customer's request. I'm making a job logging/tracking system for a clothing company. Basically I have a table of line items and a table of seamstresses. I need to list all line items that have not been assigned to a seamstress yet in an html table. To the right of each row in the html table there needs to be a drop down list of all seamstresses which the user can use to assign a seamstress to each line item. A single submit button at the bottom of the page will submit the dynamic form.

I can't make it work.

I've done forms with dropdown lists, etc. but have always only modified one record at a time and always knew exactly how many dropdown lists there would be and gave them all static names. But in this case, there could be 5 or 50 drop down lists that need to be named dynamically in a way that I can later know which record drop down "dd48" (for example) is associated with. Any clues on how to do this?

9 Years
Discussion Span
Last Post by somedude3488

have php make the select boxes.

$sel = '<select name="name">';
$query = mysql_query( "query to select seamstresses" );
while( $row = mysql_fetch_assoc( $query ) ) {
  $sel .= "<option value=\"{$row['value']}\">{$row['name']}</option>";
$sel .= '</select>';
//echo $sel where you want the dropdown
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.