Table Entries Error - Only Contains Number of Entries Displayed

Table Entries Error - Only Contains Number of Entries Displayed

twain35twain35 Posts: 3Questions: 0Answers: 0
edited July 2012 in General
Hello,
I started using DataTables several days ago, and so far it's been great. However, after editing the php code (I'm using it server side), the only entries in the database are the entries shown per page. For example, it says "Showing 1 to 10 of 10 entries (filtered from 600 total entries)".

If I select more entries, the table loads them, but only up to the number selected. The search bar also no longer works. Is there a reason this would happen? Here's the code I edited:
[code]
$sQuery = "SELECT Seq.ID, Lane, Sample, Ref, Index, Description, Control,
Stat.Read FROM Seq, Stat WHERE Seq.PKey = Stat.Seq_FKey
$sOrder
$sLimit";
[/code]
Thanks!

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    The problem will be with your use of iTotalDisplayRecords and iTotalRecords. Unless there is a filter applied - they _must_ be the same. See http://datatables.net/usage/server-side .

    Allan
  • twain35twain35 Posts: 3Questions: 0Answers: 0
    edited July 2012
    Okay, I changed the php code to have the MySQL query to be a left join instead of trying to use multiple tables, which solved the pagination error. The search bar still isn't working, but I think it may be an unrelated issue.

    Thank you for your help!

    EDIT: The search issue was due to unclear MySQL table names. Thanks again.
This discussion has been closed.