[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1928
  • Last Modified:

Jquery datatable, php, Sqlite

  I would like to use the jquery database (http://datatables.net/). However, my tables are  huge so, I will have to use the server side processing option.

I found this script on the website http://datatables.net/release-datatables/examples/server_side/server_side.html but is written for MYSQL.

The script uses some function that are not available in SQLite (SQL_CALC_FOUND_ROWS ,SELECT FOUND_ROWS())

How can I convert this script to use SQLITE.
1 Solution
you can remove the SQL_CALC_FOUND_ROWS from the query and things should be fine

       * SQL queries
       * Get data to display
      $sQuery = "
            SELECT `".str_replace(" , ", " ", implode("`, `", $aColumns))."`
            FROM   $sTable

And for SELECT FOUND_ROWS(), Just run a simple count query

/* Data set length after filtering */
      $sQuery = " SELECT count(*)  FROM   $sTable      ";

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now