Showing the wrong amount of entries
Showing the wrong amount of entries
Virtuallazy
Posts: 4Questions: 0Answers: 0
I am currently using DataTables on a local MAMP server to withdraw some information from a database and then populate the table with the information it finds.
The database receives the JSON required from a call to IdeaExtract3.php?typeID=10.
The typeID added onto the call is used in the SQL statement in the WHERE clause.
The JSON returned is as follows;
{
"sEcho": 0,
"iTotalRecords": "17",
"iTotalDisplayRecords": "17",
"aaData": [
[
"23",
"ProductID",
null
],
[
"24",
"ProductName",
null
],
[
"25",
"SupplierID",
null
],
[
"26",
"CategoryID",
null
],
[
"27",
"CategoryID",
null
],
[
"28",
"CategoryName",
null
],
[
"29",
"CategoryDescription",
null
],
[
"30",
"Picture",
null
],
[
"31",
"OrderID",
null
],
[
"32",
"ProductID",
null
],
[
"33",
"UnitPrice",
null
],
[
"34",
"Quantity",
null
],
[
"35",
"Discount",
""
],
[
"36",
"SupplierID",
null
],
[
"37",
"CompanyName",
null
],
[
"38",
"ContactName",
null
],
[
"39",
"Address",
null
]
]
}
This contains the correct information, but when displayed in the table it will say (as standard);
" Showing 1 to 10 of 10 entries (filtered from 50 total entries) "
There are 17 entries received from the database, and if I use the dropdown menu to change the table to show 25 records then it changes to this;
" Showing 1 to 17 of 17 entries (filtered from 50 total entries) "
Any idea what is causing this and how to stop it? I used the server-side template from here ( http://www.datatables.net/release-datatables/examples/server_side/server_side.html ) and only edited the php file to include my sql statement and connect to my database.
Thanks
The database receives the JSON required from a call to IdeaExtract3.php?typeID=10.
The typeID added onto the call is used in the SQL statement in the WHERE clause.
The JSON returned is as follows;
{
"sEcho": 0,
"iTotalRecords": "17",
"iTotalDisplayRecords": "17",
"aaData": [
[
"23",
"ProductID",
null
],
[
"24",
"ProductName",
null
],
[
"25",
"SupplierID",
null
],
[
"26",
"CategoryID",
null
],
[
"27",
"CategoryID",
null
],
[
"28",
"CategoryName",
null
],
[
"29",
"CategoryDescription",
null
],
[
"30",
"Picture",
null
],
[
"31",
"OrderID",
null
],
[
"32",
"ProductID",
null
],
[
"33",
"UnitPrice",
null
],
[
"34",
"Quantity",
null
],
[
"35",
"Discount",
""
],
[
"36",
"SupplierID",
null
],
[
"37",
"CompanyName",
null
],
[
"38",
"ContactName",
null
],
[
"39",
"Address",
null
]
]
}
This contains the correct information, but when displayed in the table it will say (as standard);
" Showing 1 to 10 of 10 entries (filtered from 50 total entries) "
There are 17 entries received from the database, and if I use the dropdown menu to change the table to show 25 records then it changes to this;
" Showing 1 to 17 of 17 entries (filtered from 50 total entries) "
Any idea what is causing this and how to stop it? I used the server-side template from here ( http://www.datatables.net/release-datatables/examples/server_side/server_side.html ) and only edited the php file to include my sql statement and connect to my database.
Thanks
This discussion has been closed.