Jump to content

Dead6re

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Everything posted by Dead6re

  1. This is most likely due to the encoding of the browser, you will need to tell PHP to send the header with character encoding UTF-8. header('Content-Type: text/html; charset=utf-8');
  2. Seems that PDO is supposed to act the way it is as the warning I have is a E_NOTICE error. Generally a PHP config is set with E_ALL & ~E_NOTICE for production environments and thus isn't seen. Changing the timeout seem to help reponsiveness in the script.
  3. Having trouble getting PDO exceptions to work, instead is raising the error handler in PHP. The connection string is fine, the port is supposed to be incorrect so I can generate a log message and show an simple error screen to the client. Warning: PDO::__construct() [pdo.--construct]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://127.0.0.1:3305) PHP Version 5.3.2 MySQL Version 5.1.47-community try { $options = array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION); $this->db = new PDO($dsn, $username, $password, $options); //$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //$this->db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true); } catch (PDOException $e) { $this->throwError('PDODatabase->connect', 'Connection Failed: ' . $e->getMessage()); return false; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.