Jump to content

Print Out Products Into Categories


Interista

Recommended Posts

Hello ,

I'm a newbie in PHP but I have tried so much but nth work !

I want to print out products into categories like this way :

 

Category 1 :

  1. product 1
     
  2. product 2
     
  3. product 3

Category 2:

  1. product 5
     
  2. product 7

and so on ..

 

This is my code which I'm using :

 

 

$get_products = mysql_query("select * from ((product join category on cid = p_cid) join restaurant on rid = c_rid) join restaurant_type on rtid = r_rtid
where rid = '$rest_id' order by rid, c_sortval, p_sortval");

while ($get_productsrows = mysql_fetch_assoc($get_products)) {


echo ' <div class="product-box" id="products-box">

<table width="100%;">';

echo '<tr id="'.$get_productsrows['pid'].'" rel="desc" title="' . $get_productsrows['p_desc'] . '" >
<td style="font-weight: bold;font-size:13px;" ><span class="name">' . $get_productsrows['p_name'] . '</span></td>
<td style="text-align:center;font-size:11px;" >JD <span class="price">' . $get_productsrows['p_price'] . '+</span></td>
<td style="text-align:center;"><input type="submit" value="Add" class="btn-add"></td>
</tr>


</table></div>';

 

This is only print out the all products for all categories for the restaurant ID .

Link to comment
https://forums.phpfreaks.com/topic/269781-print-out-products-into-categories/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.