pdo server side script - invalid parameter number
pdo server side script - invalid parameter number
I am using the pdo script available here - https://gist.github.com/jjb3rd/3156545
I am also using 'PDO::ATTR_EMULATE_PREPARES => false' for my pdo database connection. This causes the following error :
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
This only happens when using the search box. From what I can gather this is because of the variable binding? Anyone with more experience with pdo and the searching shed some light on this? I realize the 1.10 will have pdo, but this does not help me with 1.9.
I am also using 'PDO::ATTR_EMULATE_PREPARES => false' for my pdo database connection. This causes the following error :
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
This only happens when using the search box. From what I can gather this is because of the variable binding? Anyone with more experience with pdo and the searching shed some light on this? I realize the 1.10 will have pdo, but this does not help me with 1.9.
This discussion has been closed.
Replies