dhimok Posted September 4, 2007 Share Posted September 4, 2007 How can I paginate this query using array_chunk() and array_slice() <?php function get_products($id) { global $products; $result = mysql_query("SELECT * FROM products WHERE category_id = '{$id}' ORDER BY price ASC "); while($row = mysql_fetch_object($result)) { $products[] = $row->product_id; } //get children $result = mysql_query("SELECT category_id FROM categories WHERE parent_id = {$id}"); while ($row = mysql_fetch_assoc($result)) { get_products($row["category_id"]); } } ?> Some ahead start would be a great help Quote Link to comment https://forums.phpfreaks.com/topic/67935-array_slice/ 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.