Jump to content

Query for grouping products


graham23s

Recommended Posts

Hi Guys,

 

I can't remember the query i need here lol, basically in my master logs table i have:

 

ID | PRODUCT_ID | CART_ID | DATE

1 | 23 | 1234 | 11/10

2 | 27 | 1235 | 12/10

3 | 27 1236 | 12/10

 

i'm trying to group together the number product id's so i can keep track of the number sold of that product i forget the query though.

 

thanks guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/181485-query-for-grouping-products/
Share on other sites

Hi Mate,

 

That's the one  i remembered after i posted :) i usually code in vb.net haven't done php in a while

 

i have:

 

  $qQ1 = "SELECT DISTINCT 'PRODUCT_ID' FROM `fcp_orders_master_log` GROUP BY `uniqueCount` LIMIT $num, $max";
  $rQ1 = mysql_query($qQ1);
  $numResultsWithClause = mysql_num_rows($rQ1);
  
  $test = $aQ1['uniqueCount'];
  print $test;

 

But it's not printing me anything, the syntax seems ok.

 

cheers

 

Graham

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.