Forum Moderators: coopster
<?php
$query1 = "(SELECT DESCRIPTION from oemmodem56c2)
UNION
(SELECT DESCRIPTION from fg000092)
UNION
(SELECT DESCRIPTION from fg000071)
UNION
(SELECT DESCRIPTION from gprs0007)
UNION
(SELECT DESCRIPTION from gprs0003)
UNION
(SELECT DESCRIPTION from carrierboard)
UNION
(SELECT DESCRIPTION from boxproduct)
UNION
(SELECT DESCRIPTION from fr06000104)";
$result1 = mysql_query($query1);
$num_rows=mysql_num_rows($result1);
while ($row=mysql_fetch_array($result1))
{
$DESCRIPTION = $row["DESCRIPTION"];
echo "<option value=\"$DESCRIPTION\">$DESCRIPTION</option>";
}
echo "</select><br>";
?>
The bigger question is, once a description is selected, how are you going to know which table to query next? Or don't you need to?
Once a description is selected then another page loads up containing the right input fields for that product.
why do you have all the descriptions in multiple tables?
I have mulitple products with differant descriptions, I have created and new table for each product.
I have never created a db before so maybe mulitple tables is not the best way to do it. Any pointers would not go a miss.
Once all the products are stored in a single table, now all you have to do is query one table as opposed to all those UNION SELECTions. Make sense?