Im currently trying to query a table, and with the results from the first table, run a new query on the second table - the way im trying to do it is:
At the top of the page i have the following two queries:
$query1 = mssql_query("
$query2 = mssql_query("
and then further down the page i have the following to display the data:
while($MRPDATA = mssql_fetch_array($query1))
while($BOM = mssql_fetch_array($query2))
echo "<td>" . $BOM['ProductID'] . "</td>";
echo "<td>" . $BOM['ComponentID'] . "</td>";
echo "<td>" . $BOM['PerAssyQty'] . "</td>";
The problem i have is that query2 in the first section of code wont work with the '$MRPDATA[StockCode]' included - if i replace that with a static part number it works fine...
Anyone know how i can get the variable to work within the query?