Help selecting field data through adrop down list
I have several sets of information that need to be selected through drop down lists. I need to select the field from the list, as well as passing other fields from the same data row into unique new fields.
I currently have the drop down selecting the correct fields, then I am attempting to add the other info through text boxes, unfortunately the text box becomes a loop that shows a text box for all 800+ entries. How can I make my text box selection equal to the same row as my drop down list?
See what is happening here: http://pitzermedia.com/esalem/explode.php
from my initial page:
PHP Code:
<?php
$query="SELECT id, PMS, HEX FROM PMStoHEX";
$result=mysql_query($query);
echo '<select name="spot1">';
while($nt=mysql_fetch_array($result))
{ // Array or records stored in nt
echo '<option value="'.$nt['PMS'].'">' .$nt['PMS'].'</option>';}
$query="SELECT id, PMS, HEX FROM PMStoHEX";
$result=mysql_query($query);
while($nt=mysql_fetch_array($result))
{
echo'<input name="HEX1" type="text" value="'.$nt['HEX'].'"></input>';
}
echo '</select>'; // closing list
?>
then from my action page:
PHP Code:
mysql_select_db($database_doristest, $doristest);
$part = explode("|", $_POST['PMS']);
// $part[0] is now id// $part[1] is now pms// $part[2] is now hex
$id=$part[0];
$pms=$part[1];
$hex=$part[2];
Thanks for any help,
Patrick