Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author john ackers

    (@john-ackers)

    The syntax looks right. Can you post up the line from the access log that shows the (ajax) page request, I just want to make sure that the request to the server is correct. You are looking for something like this:
    GET /wp3/wp-admin/admin-ajax.php action=dbview&verb=autoLoad&name=show+all+options&pageSize=19 HTTP/1.1

    thanks john

    Thread Starter hoffm11

    (@hoffm11)

    Is there a way for me to look at this log via WordPress? How?

    Thread Starter hoffm11

    (@hoffm11)

    Plugin Author john ackers

    (@john-ackers)

    The ajax request is correct so I think something is going wrong on the PHP/server side. To make the paging work, the SQL statement is appended with LIMIT and OFFSET parameters. If you go into tools, there is a pre-installed dbview called show all options that displays the contents of wp_options table and the results should be paginated. Does this work for you? If yes I’d try a simple SQL query and make sure the results get paginated. Or just post up your SQL statement here and I’ll take a look.

    John

    Thread Starter hoffm11

    (@hoffm11)

    Hi, I did look at those samples and the paging does work. Here is my SQL:

    SELECT division, month, day, year, gamecode, hometeam, homescore, visitteam, visitscore FROM game_scores where homescore > 0 or visitscore >0 and year = 2014 order by month DESC, day DESC LIMIT 20;

    I don’t see the offset and limit on the SQL query for the show all options. That is probably where I am confused..

    Plugin Author john ackers

    (@john-ackers)

    I think that if you have put in your own LIMIT statement then the plugin will not append or edit your SQL statement. Try removing the LIMIT 20. There should be a warning to say that, apologies.

    Thread Starter hoffm11

    (@hoffm11)

    odd.. So I removed the limit and when I try to execute it, I get

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘LIMIT 20 OFFSET 0’ at line 1

    SELECT division, month, day, year, gamecode, hometeam, homescore, visitteam, visitscore FROM game_scores where homescore > 0 or visitscore >0 and year = 2014 order by month DESC, day DESC;

    Plugin Author john ackers

    (@john-ackers)

    Try dropping the semi colon.

    Thread Starter hoffm11

    (@hoffm11)

    YES! Works now! Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Pagination Doesn't work’ is closed to new replies.