08-15-2017, 11:58 AM
After adding in the below line of code into the DB Class for an insert command
$this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
I receive the below error:
Is there any issue with the public function query($sql, $params = array()) Do you get the same error thrown if you add in the error reporting and run any insert SQL commands? The insert command seems to work so it looks like it is throwing an error while running this check:
<pre></pre>
$this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
I receive the below error:
Code:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error' in /var/www/fas/users/classes/DB.php:57 Stack trace: #0 /var/www/fas/users/classes/DB.php(57): PDOStatement->fetchAll(5) #1 /var/www/fas/users/classes/DB.php(123): DB->query('INSERT INTO job...', Array) #2 /var/www/fas/includes/helpers/form_helpers.php(91): DB->insert('jobs', Array) #3 /var/www/fas/confirm_job.php(17): insert_job_form('XX', 'NA..') #4 {main} thrown in /var/www/fas/users/classes/DB.php on line 57
Is there any issue with the public function query($sql, $params = array()) Do you get the same error thrown if you add in the error reporting and run any insert SQL commands? The insert command seems to work so it looks like it is throwing an error while running this check:
<pre>
Code:
if (!$this->query($sql, $fields)->error()) {
return true;
}