How to get total rows
How to get total rows
adromil
Posts: 53Questions: 4Answers: 0
I have been using dataTables for quite sometime starting from version 1.6.4,
I have known that using oTable.fnSettings().fnRecordsTotal() will return the number of rows there are in the table.
However though, having updating to 1.10.1 I don't find any documentation that will provide me the same result.
Hoping for your inputs
Best regards
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
//get the number of rows in total
$total_query = mysql_query("SELECT COUNT(id) FROM {$table} ")
or die(mysql_error());
$row = mysql_fetch_array($total_query);
$response['iTotalRecords'] = $row[0];
Thank you your for your response, however, what I need is a return using dataTables API. It is tedious if I am going to use AJAX and get the return. It is more appropriate if I will get the number of rows the dataTable using sever-side source in dataTables' function API in javascript.
Use
page.info()
.Allan