Total entries listed in the footer is wrong
Total entries listed in the footer is wrong
compcentral
Posts: 40Questions: 0Answers: 0
I have 12 entries in my database, but "iTotalRecords" is showing 48 for some reason and I get this in the footer:
Showing 1 to 12 of 12 entries (filtered from 48 total entries)
website is here:
http://blogs.wiueacademy.org/courseenroll/Course_Listing.php
Help please.
Showing 1 to 12 of 12 entries (filtered from 48 total entries)
website is here:
http://blogs.wiueacademy.org/courseenroll/Course_Listing.php
Help please.
This discussion has been closed.
Replies
I modified this section in the ajax php file (changed $sTable to $sIndexTable):
[code]
/* Total data set length */
$sQuery = "
SELECT COUNT(".$sIndexColumn.")
FROM $sIndexTable
";
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
$aResultTotal = mysql_fetch_array($rResultTotal);
$iTotal = $aResultTotal[0];
[/code]
I had to set $sIndexTable to the courses table. It was off because I had multiple tables set for $sTable to use concat() in my initial SQL query. So I now have this:
[code]
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "courseID";
$sIndexTable = "courses";
/* DB table to use */
$sTable = "courses c, teachers t, districts d";
[/code]