Reputation: 3510
Server-side datatables. everything is working fine except the search box. Soon as I enter one character in the search, this error shows up:
DataTables warning (table id = 'sample_1'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number' in /home/test/public_html/assets/data-tables/test-pdo.php:99
Stack trace:
#0 /home/test/public_html/assets/data-tables/test-pdo.php(99): PDOStatement->execute()
#1 /home/test/public_html/assets/data-tables/test-pdo.php(143): TableData->get('accounts', 'account_id', Array)
#2 {main}
thrown in /home/test/public_html/assets/data-tables/test-pdo.php on line 99
line 99 is -$statement->execute();
from Bind Parameters
I am using the pdo script for datatables listed here
Upvotes: 2
Views: 877
Reputation: 2812
Validate your JSon response here http://jsonlint.com/
Check if its an invalid or a valid JSON.
Also your Jquery is firing command as soon as you enter some data in search box.
Try checking the Database attribute type for errors (Number or text).
Upvotes: 0
Reputation: 544
The error which you are receiving is because you went something wrong in your php code. jQuery just loads your php page and gives you the output.
Upvotes: 1
Reputation: 526
this is a SQL error not Jquery... Please check your passed parameters..
Upvotes: 4