Author Topic: Undefined class constant 'MYSQL_ATTR_FOUND_ROWS'  (Read 7262 times)

Offline feinraf

  • Newbie
  • *
  • Posts: 6
Undefined class constant 'MYSQL_ATTR_FOUND_ROWS'
« on: August 04, 2013, 09:25:26 AM »
Hi, I am getting this error when checking the database in the Roundcube installation.

Fatal error: Undefined class constant 'MYSQL_ATTR_FOUND_ROWS' in /program/lib/Roundcube/rcube_db_mysql.php on line 134

Here is line 134:

Code: [Select]
$result[PDO::MYSQL_ATTR_FOUND_ROWS] = true;
Here is the rest of the code around it for some more detail:

Code: [Select]
protected function dsn_options($dsn)
    {
        $result = array();

        if (!empty($dsn['key'])) {
            $result[PDO::MYSQL_ATTR_KEY] = $dsn['key'];
        }

        if (!empty($dsn['cipher'])) {
            $result[PDO::MYSQL_ATTR_CIPHER] = $dsn['cipher'];
        }

        if (!empty($dsn['cert'])) {
            $result[PDO::MYSQL_ATTR_SSL_CERT] = $dsn['cert'];
        }

        if (!empty($dsn['capath'])) {
            $result[PDO::MYSQL_ATTR_SSL_CAPATH] = $dsn['capath'];
        }

        if (!empty($dsn['ca'])) {
            $result[PDO::MYSQL_ATTR_SSL_CA] = $dsn['ca'];
        }

        // Always return matching (not affected only) rows count
        $result[PDO::MYSQL_ATTR_FOUND_ROWS] = true;

        // Enable AUTOCOMMIT mode (#1488902)
        $dsn_options[PDO::ATTR_AUTOCOMMIT] = true;

        return $result;
    }

My server is running PHP 5.3.26 and it has the pdo_mysql thing installed too.



-

Any suggestions?
« Last Edit: August 04, 2013, 09:28:06 AM by feinraf »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Undefined class constant 'MYSQL_ATTR_FOUND_ROWS'
« Reply #1 on: August 04, 2013, 01:59:19 PM »
Some people have fixed the error it by recompiling php, what version of php are you running?

Offline Dennis1993

  • Full Member
  • ***
  • Posts: 69
Re: Undefined class constant 'MYSQL_ATTR_FOUND_ROWS'
« Reply #2 on: August 04, 2013, 03:45:25 PM »
[...]what version of php are you running?

[...] My server is running PHP 5.3.26 and it has the pdo_mysql thing installed too. [...]

 :D

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Undefined class constant 'MYSQL_ATTR_FOUND_ROWS'
« Reply #3 on: August 04, 2013, 03:52:20 PM »
Sorry I didn't see that, the only thing I can suggest is to recompiling php.