error with search box, but everything else works - pdo style

error with search box, but everything else works - pdo style

mihomesmihomes Posts: 165Questions: 23Answers: 0
edited November 2013 in DataTables 1.9
I am using server-side php to grab data from my database in pdo style using the script found here - https://gist.github.com/jjb3rd/3156545

Searching is not working for me and not sure why... everything else is working fine. Any ideas?

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

Aside from this issue... how the heck do I only return specific rows from the database? In my situation nearly every instance where I use datatables I do not want to return all rows in the table because I will need to use something like WHERE user=user or WHERE id=id so only specific data is returned and allowed to be sorted.
This discussion has been closed.