upp Posted November 19, 2010 Share Posted November 19, 2010 hello guys, im creating a search result page that uses pagination, and im trying to figure out how many total pages their are going to be in my links with the page numbers. this is probably something really simple, ive been writing scripts for the last few hours and have a bit of a headache, any help would be appreciated here's the coding and the results i want: <?php $per_page = 10; $rows = mysql_query("SELECT COUNT(*) FROM articles WHERE text LIKE $string"); // this will return 31 $pages = $rows / $per_page; // returns 3.1 $total_pages = round($pages); // returns 3, want to round 3.1 up to 4 here ?> Link to comment https://forums.phpfreaks.com/topic/219185-round-31-up-to-4/ Share on other sites More sharing options...
Pikachu2000 Posted November 19, 2010 Share Posted November 19, 2010 ceil() Link to comment https://forums.phpfreaks.com/topic/219185-round-31-up-to-4/#findComment-1136590 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.