Okay, I'm trying to output data from one table, with only certain instances pulling up data from another table.
On a value of 0 in PriceID, it uses values in the first table; on a value of anything else, it should pull a set of values from the second table.
<?php
$dbcon = mysql_connect("sqlserv","user","pass");
if (!$dbcon)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("exqp_db", $dbcon);
$result = mysql_query("SELECT * FROM itemlist");
while($row = mysql_fetch_array($result))
{
if ($row['Active'] == "1")
{
$ps = $row['PriceID'];
echo
$row['ID'] . " " .
$row['Name'] . " " .
$row['Catalog'] . "<br />" .
$row['SDesc'] . "<br />" .
$row['LDesc'] . "<br /> ";
if ($row['PriceID'] == "0"){
echo
"$" . $row['Price'] . " Per " . $row['PerA'] . "<br /> $" .
$row['PriceB'] . " Per " . $row['PerB'] . "<br />";}
else {
$result = mysql_query("SELECT * FROM pricesets WHERE ID=$ps");
echo "$" . $row['25'] .
"<br /> $" . echo $row['50'] .
"<br /> $" . echo $row['75'] .
"<br /> $" . echo $row['100'] .
"<br /> $" . echo $row['125'] .
"<br /> $" . echo $row['150'] .
"<br /> $" . echo $row['175'] .
"<br /> $" . echo $row['200'];}
echo
"<br /><a href=" . $row['ImgSrc'] . "><img src=" . $row['ThumbSrc'] . " border=0></a><br />" .
$row['ModTime'];
echo "<br /> <img src=ddiv.gif> <br />";
}
else echo "";}
mysql_close($dbcon);
?>