You have set a limit in your search query on line 42:
The value of '$per_page' is set to 5 in line 19 so that query only returns five results! If you want to return all the matching results starting from '$start_from' then you must change LIMIT to OFFSET. Your query should look like this:Code:$result = $db->prepare("SELECT * FROM purchased_software WHERE sales_month BETWEEN :a AND :b ORDER BY id LIMIT $start_from, $per_page");
See here for the usage of LIMIT and OFFSET in MYSQL.Code:$result = $db->prepare("SELECT * FROM purchased_software WHERE sales_month BETWEEN :a AND :b ORDER BY id OFFSET $start_from");



Reply With Quote


Bookmarks