Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'pagination'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 10 results

  1. Hello all, I am busy with a complete user management script and have the following questions: Is it good practice to combine the "view users" and "search users" scripts in the same PHP file? How do I amend the "SELECT COUNT(user_id) FROM users" query for pagination purposes to accommodate the search functionality? In its current form it continues to displays ALL the pagination links after a search query. Is there a more efficient way to formulate the following search query: "SELECT u.user_id, u.username, u.type, c.country, u.email, u.status, DATE_FORMAT($date_created, '%Y-%m-%d %H:%i:%s')
  2. I am building a forum from the example in the book, and I am having trouble getting the page numbers to work like they should, right now the thread results don't update when you click on other page numbers, it is always the same query results on every page. Here is some code where I think the problem is, but I can't find it. I would post the whole page's code, but I have done that before and didn't get many helpers for that. The query I am using is $sql = "SELECT t.thread_id, t.subject, u.username, COUNT(p.post_id) - 1 AS responses, MAX(DATE_FORMAT($last, '%e-%b-%y %l:%i %p')) AS last
  3. i have went thru this script forward and backwards a million and still have problems, i am not getting any error msgs, i am completely lost. please help. <?php # Script 10.4 - view_users.php #4 // this script retrieves all the records from the user table // the new version paginates the query results $page_title = 'View the Current Users'; include ('include/header.html'); echo '<h1>Registered Users</h1>'; require_once ('mysqli_connect.php'); // Number of records to show per page $display = 10; // determine how many pages there are if (isset($_GET['p']) &&
  4. Hi, I am having problems with pagination. I thought I had script 9.4 working without any problems, so carried on with script 9.5, which I also thought was working OK. I then added another table to my online database which I accessed by a script based on 9.5, but then I found the pagination wasn't working. I then found the pagination in script 9.5 wasn't working. The s and p appear in the url address line, and it would appear the code: if (isset($_GET['s']) && is_numeric($_GET['s'])) { $start = $_GET['s']; } else { $start = 0; } is ignored, as start always
  5. Hi everyone, I'm on chapter 10 right now, I want to add some style to the pagination using <ul> and <li>, i'm trying this way... if ($pages > 1) { echo '<ul class="pagination margin-none pull-right"><li>'; $current_page = ($start/$display) + 1; if($current_page != 1){ echo '<a href="view_users.php?s=' . ($start - $display) . '&p=' . $pages . '">Previous</a> '; } for($i = 1; $i <= $pages; $i++){ if($i != $current_page){ echo '<a href="view_users.php?s=' . (($display * ($i - 1))) . '&p=' . $pages . '">' . $i
  6. Following the book I have successfully used pagination. It looks great! Now however, Im getting to the point where I have multiple rows of page numbers. What could I start to look at so instead of this, < 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39> I could get this, < 1... 8 9 10 11 12 13 ...39 > Thanks!
  7. Hello all. I am a relative newbie to php and mysql but have been progressing through book with great results up until i have hit a wall with a pagination script. The scripts used are a combination of 9.4 - paginate view users and chapter 17 ecommerce from the PHP 6 and MySQL 5 book. The issue involves the script not creating further links for additional pages should the results returned exceed the $display variable. I don't get any next or previous links at all and for the life of me cannot see why. The page displays with whatever the $display number is set out but no links to addi
  8. I am practisng how to create pagination in chapter 10 - page: 317 and I want to add class to the current page so I can style it using CSS. When I try to add a class, or use float in CSS, I run into a problem. Can you help me solve this problem? Excerpt of the colde: // Make the links to other pages: if($pages > 1) { echo ' <p id="pagination"> '; $current_page = ($start/$display) + 1 ; // If it is not the first page, make a previous link: if($current_page != 1) { echo ' <a href="view_users.php?s=' . ($start - $display).'&p=' . $pages . '&sort='. $so
  9. mint

    Pagination

    There is a for loop which iterates and displays some links, the number of links depends on a database value which lies in range of 100's, is there any way to paginate the links to display 10 links one at a time through pagination. Here is the code foreach ($records as $record): echo CHtml::link('Transaction ID #'.$record->RBT_Transaction_ID,array('mobdistinct','mobtrans'=>$record->RBT_Transaction_ID)); ?> <br> <?php endforeach; ?>
  10. Hi Larry and forum users. I have a problem that I can't resolve. I have set up my pagination script to display 5 blog posts per page. (I'm working on a local server at present so unfortunately I can't provide a link to the page). Currently, there are 15 blog posts in my db. Obviously, the pagination numbers at the bottom of my page should show three digits, '1', '2', and '3', with each page showing 5 posts. The thing is, I see four digits: '1', '2', '3'... and '4'. When I click '1', I see the first 5 records and "index.php?s=0&p=4" is displayed in my url. Clicking '2' shows me
×
×
  • Create New...