PHP, MySQL
I have a database form with on multiple select field (drop down list). I concatenate and store the selected values in a single field ( 1 2 3). I can do this without a problem. I can also retrieve and split the values quite well. My problem, as you will see from the following snippet is that the values are id's - and I would like to use these to retrieve associated descriptions (names) from a parent table.
<?
$product_id=mysql_result($resultupdate,$x,"product_id");
$pieces = explode(" ", $product_id);
$countx =count($pieces);
$i = 0;
while ($i < $countx) {
$id=$pieces[$i];
echo $id;
$query = "select product_name from products where product_id='$id'";
$product_name = MYSQL_QUERY($query);
$product_name;
echo("\n");
$i++;
}
?>
everything works except the part where I attempt to retrieve 'product_name'. Can anybody help please. I am relatively new at this and would appreciate a response in layman's terms if possible.
I have also been grappling with the idea of not only returning the product_name values, but displaying them 'selected' in a drop-down list. I have been wrestling withis for days - I'm a little more than a beginning programmer, but I sure could use some help.
iRex:eek: