dhimok Posted September 3, 2007 Share Posted September 3, 2007 How to get total count from this function. I am having problems to get the right count when I am on a parent category <?php function get_items($id) { $result = dbQuery(" SELECT * FROM items WHERE category_id = '{$id}' ORDER BY price ASC LIMIT $offset, $rowsPerPage "); while($row = mysql_fetch_object($result)) { $products[] = $row; } $result = mysql_query("SELECT category_id FROM cats WHERE parent_id = {$id}"); while ($row = mysql_fetch_assoc($result)) { get_items($row["category_id"]); } } } ?> thanks Link to comment https://forums.phpfreaks.com/topic/67836-count-issue/ Share on other sites More sharing options...
darkfreaks Posted September 3, 2007 Share Posted September 3, 2007 <?php $row_count = mysql_num_rows($result); echo count($products); ?> Link to comment https://forums.phpfreaks.com/topic/67836-count-issue/#findComment-340968 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.