View Single Post
  #3 (permalink)  
Old 03-12-2007, 03:47 PM
percycode percycode is offline
Junior Member
 
Join Date: Mar 2007
Posts: 4
Smile Extended db class to support column case

Going off your suggestion I was able to find this post:
Nabble - How to specify Charset with PDO/MySQL

Which led me to extend the Zend Mssql class as the example showed:

class X_Db_Adapter_Pdo_Mssql extends Zend_Db_Adapter_Pdo_Mssql {
protected function _connect() {
if ($this->_connection)
return;

parent::_connect();

// please do not touch names if I don't tell you to do so
$this->_connection->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL);

}
}

The only downside is that I have to manually include more files since I can't use the factory.
require_once("Zend/Db/Adapter/Pdo/Mssql.php");
require_once("Zend/Db/Adapter/Pdo/X_Mssql.php");

And then create my connection like so:
$db = new X_Db_Adapter_Pdo_Mssql($db_params);

But after doing so my columns are coming back in the original case.

I was not able to find a way to pass the attribute changes through the config or factory.

Thanks!!
Reply With Quote