graham23s Posted November 14, 2009 Share Posted November 14, 2009 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 Quote Link to comment Share on other sites More sharing options...
joquius Posted November 14, 2009 Share Posted November 14, 2009 SELECT DISTINCT(`PRODUCT_ID`) FROM `table`; ? Quote Link to comment Share on other sites More sharing options...
graham23s Posted November 14, 2009 Author Share Posted November 14, 2009 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.