I can not. Because Cost is not in the table i am fetching the list from.
PHP Code:
$get_items_query=mysql_query("SELECT xItemid FROM shops_items WHERE xShopid='".$userinput["xShopid"]."'");
while ($item_list=mysql_fetch_assoc($get_items_query)) {
$item_info=mysql_fetch_assoc(mysql_query("SELECT xName,xCost,xSale,xType FROM items WHERE xId='".$item_list["xItemid"]."'"));
echo "<tr><td>".$item_info['xName']."</td><td>".get_item_type($item_info['xType'])."</td><td>";
if ($item_info['xCost']>0) echo "$".$item_info['xCost']; else echo "Cannot Buy";
echo "</td><td>";
if ($item_info['xSale'] > -1) echo "$".$item_info['xSale']; else echo "Cannot Sell";
echo "</td></tr>";
}
As you can see i collect a list of items that are found in a place, then fetch the info about that item from the item table. Due to database normalisation!
Bookmarks