The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error reporting for DB queries
#8
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:

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;
        }
</pre>


  Reply


Messages In This Thread
Error reporting for DB queries - by plb - 08-27-2016, 12:47 PM
Error reporting for DB queries - by mudmin - 08-27-2016, 01:11 PM
Error reporting for DB queries - by mudmin - 08-27-2016, 01:11 PM
Error reporting for DB queries - by plb - 08-27-2016, 01:51 PM
Error reporting for DB queries - by waynez - 03-09-2017, 06:03 PM
Error reporting for DB queries - by mudmin - 03-09-2017, 09:32 PM
Error reporting for DB queries - by jmac - 08-15-2017, 10:57 AM
Error reporting for DB queries - by jmac - 08-15-2017, 11:58 AM
Error reporting for DB queries - by jmac - 08-15-2017, 11:25 PM
Error reporting for DB queries - by karsen - 08-17-2017, 06:26 PM
Error reporting for DB queries - by mudmin - 08-18-2017, 11:38 AM
Error reporting for DB queries - by mudmin - 08-18-2017, 03:01 PM
Error reporting for DB queries - by karsen - 08-18-2017, 05:09 PM
Error reporting for DB queries - by karsen - 08-18-2017, 07:06 PM
Error reporting for DB queries - by jmac - 08-19-2017, 04:34 AM
Error reporting for DB queries - by mudmin - 08-24-2017, 10:21 AM
Error reporting for DB queries - by mudmin - 08-25-2017, 12:14 PM
Error reporting for DB queries - by Katronix - 09-03-2017, 03:13 AM
Error reporting for DB queries - by Katronix - 09-03-2017, 03:32 AM
Error reporting for DB queries - by mudmin - 09-03-2017, 12:47 PM
Error reporting for DB queries - by Katronix - 09-03-2017, 02:56 PM
Error reporting for DB queries - by mudmin - 09-03-2017, 03:07 PM

Forum Jump:


Users browsing this thread: 5 Guest(s)