Cinner Posted December 6, 2007 Share Posted December 6, 2007 Hey guys, I'm building a shopping cart system for myself, and could use some help. My MYSQL database has a table called PRODUCTS, with the following fields: ID | TITLE | TYPE I have a shopping basket array (called $items) containing product ID's, for example: 1, 3, 2, 2, 3, 3. I can query the products from my database, based on the ID's in that array. But I would like to count the corresponding TYPEs of those products, and I'm not sure how (the TYPE is not in the array)? I need to know (count) how many times an ID was placed in the $items array, and what the corresponding TYPES are by querying the database (so I can say TYPE x was placed x times in the shopping basket). Link to comment https://forums.phpfreaks.com/topic/80485-array-to-query-to-array-and-counting-the-items-in-the-process/ Share on other sites More sharing options...
Psycho Posted December 6, 2007 Share Posted December 6, 2007 Misread the post. Revising my response.... Link to comment https://forums.phpfreaks.com/topic/80485-array-to-query-to-array-and-counting-the-items-in-the-process/#findComment-408116 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.