Jump to content

count issue


dhimok

Recommended Posts

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

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.