Hi All,
is it perhaps better to go with a 2nd query like below, as opposed to an Inner Join.? Currently the code below only populates the 1st Select Box. I'm a little confused with whether I need to re-open the db connection and also whether my variable naming is correct too.
<html>
<body>
<hr>
<h1 align=center>JUMBO STATUS</h1><p>
<center>Used Hardware Specialist</center>
<hr>
<h2 align=center>Admin</h2>
<table align="center" border="2">
<tr>
<td><h3 align=center>PRODUCT TYPE</h3></td>
</tr>
<tr><td><center>
<select name="poduct_type">
<?php
$db = mysql_connect("localhost", "root", "grunger");
mysql_select_db("status",$db);
$result = mysql_query("SELECT ProductTypes.product_type_detail, ProductTypes.product_type_id FROM ProductTypes",$db);
$num = mysql_num_rows($result);
for ($i=0; $i<$num; $i++){
$myrow=mysql_fetch_array($result);
$product_type=mysql_result($result,$i,"product_type_detail");
$product_type_id=mysql_result($result,$i,"product_type_id");
$maker=mysql_result($result,$i,"maker_detail");
$maker_id=mysql_result($result,$i,"maker_id");
echo "<option value=\"$product_type_id\">$product_type</option><br>";
}
?>
</select>
</center>
</td></tr>
</table>
<table align="center" border="2">
<tr>
<td><h3 align=center>Maker</h3></td>
</tr>
<tr><td><center>
<select name="slect_maker">
<?php
$maker_db = mysql_connect("localhost", "root", "grunger");
mysql_select_db("status",$maker_db);
$maker_result = mysql_query("SELECT Makers.maker_id Makers.maker_detail FROM Makers",$maker_db);
$maker_num = mysql_num_rows($maker_result);
for ($i=0; $i<$maker_num; $i++){
$maker_myrow=mysql_fetch_array($maker_result);
$maker=mysql_result($maker_result,$i,"maker_detail");
$maker_id=mysql_result($maker_result,$i,"maker_id");
echo "<option value=\"$maker_id\">$maker</option><br>";
}
?>
</select>
</center>
</td></tr>
</table>
<p>
<p>
<p>
<hr><center>email: ????????????<p>
Telephone: ???????<p>
Fax: ????????????
</center>
<hr>
</body>
</html>