Hi,
I am creating an admin section for a website that I want to be able to select a colour for Main, Trim and Ribbon colours for an item.
I have created a page which works, but the trim and ribbon colours will not show? The code is shown below.
<th nowrap="nowrap" align="right">Colour :</th>
<td><select name="productmain">
<?php
do {
?>
<option value="<?php echo $row_rsColour['coloursid']?>" ><?php echo $row_rsColour['coloursname']?></option>
<?php
} while ($row_rsColour = mysql_fetch_assoc($rsColour));
?>
</select>
</td>
</tr>
<tr valign="baseline">
<th nowrap="nowrap" align="right">Trim :</th>
<td><select name="producttrim">
<?php
do {
?>
<option value="<?php echo $row_rsColour['coloursid']?>" ><?php echo $row_rsColour['coloursname']?></option>
<?php
} while ($row_rsColour = mysql_fetch_assoc($rsColour));
?>
</select>
</td>
</tr>
<tr valign="baseline">
<th nowrap="nowrap" align="right">Ribbon :</th>
<td><select name="productribb">
<?php
do {
?>
<option value="<?php echo $row_rsColour['coloursid']?>" ><?php echo $row_rsColour['coloursname']?></option>
<?php
} while ($row_rsColour = mysql_fetch_assoc($rsColour));
?>
</select>
</td>
</tr>
I have one table in the database that holds the colour information, and I want to use the information held in this table to populate the drop down lists but it will not work as I have programmed it.
The only other way I know how to do it is to create a separate table for Main, Trim and Ribbon colours. The only downside of this is I want each table to hold the same list of colours. If I need to do it this way, how do I ensure that all the tables hold the same information.
Any Ideas or advice would be much appreciated.
Phil