This may be more of a MySQL question than PHP, but I'm hoping someone can point me in the right direction. I have working code (below) that pulls data from a particular category in our db. I'd like to be able to pull data from multiple categories in the same db and place them on the same page.

I've been working on this for the last 4 days with no luck. Some pages say that you can't do multiple MySQL queries while others say there is a workaround but I haven't found it. Does anyone know how to do this?



<?php require_once("/home/balcone/db_login.php"); ?> // in header

        $item_list = "";
        $cat1 = "01100-01200-01300-06403";
$result = mysql_query("SELECT itemid,description,unitprice FROM catalog WHERE categories='" . $cat1 . "' ORDER BY itemid",$db);

while ($item = mysql_fetch_assoc($result))
$item_list .= "<tr><td>" . $item['itemid'] . "</td>
<td><a href=\".../shop.cgi?c=detail.htm&amp;itemid=" . $item['itemid'] . "=1\">". $item['description'] ."</a></td>
        <td align=\"right\">$". money_format('%i', $item['unitprice']) ."</td>
echo "<table border=\"1\"><tr><th>Item ID</th><th>Description<br / ><font size=\"-1\">(Click for more info)</font></th><th>Price Each</ th><th>Purchase</th></tr>$item_list</table>";

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to