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

Jquery datatable, php, Sqlite

Hello,
  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.
0
SiemensSEN
Asked:
SiemensSEN
1 Solution
 
babuno5Commented:
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
            $sWhere
            $sOrder
            $sLimit
            ";

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

/* Data set length after filtering */
      $sQuery = " SELECT count(*)  FROM   $sTable      ";
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

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