Edit report at https://bugs.php.net/bug.php?id=64161&edit=1

 ID:                 64161
 Comment by:         jwatson at fh dot org
 Reported by:        sivavivekanantha at gmail dot com
 Summary:            PDO::__construct(): Called dbsetopt with parameter 3
                     NULL (severity 11)
 Status:             Open
 Type:               Bug
 Package:            PDO related
 Operating System:   linux centos 6
 PHP Version:        5.4.11
 Block user comment: N
 Private report:     N

 New Comment:

This may be a duplicate of issue #63638.

If so, a patch/pull request was submitted at https://github.com/php/php-
src/pull/306. Waiting on php developers to roll this into their release.


Previous Comments:
------------------------------------------------------------------------
[2013-02-06 04:52:28] sivavivekanantha at gmail dot com

Description:
------------
PDO::__construct(): Called dbsetopt with parameter 3 NULL (severity 11)


/var/www/framework/db/CDbConnection.php(423)

411     protected function createPdoInstance()
412     {
413         $pdoClass=$this->pdoClass;
414         if(($pos=strpos($this->connectionString,':'))!==false)
415         {
416             $driver=strtolower(substr($this->connectionString,0,$pos));
417             if($driver==='mssql' || $driver==='dblib')
418                 $pdoClass='CMssqlPdoAdapter';
419             elseif($driver==='sqlsrv')
420                 $pdoClass='CMssqlSqlsrvPdoAdapter';
421         }
422         return new $pdoClass($this->connectionString,$this->username,
423                                     $this->password,$this->_attributes);


Test script:
---------------
$sql = "[sp_Language] :Language_Code, :Language_Name, :Active, :Disp_Order, 
:Action ";
           $command = $this->createCommand($sql);
           $command->bindParam(":Language_Code",    $languageCode,  
PDO::PARAM_INT);
           $command->bindParam(":Language_Name",        $language,              
PDO::PARAM_STR);
           $command->bindParam(":Active",                       $active,        
        PDO::PARAM_STR);
           $command->bindParam(":Disp_Order",           $displayOrder,  
PDO::PARAM_INT);                   
           $command->bindParam(":Action",                       $action,        
        PDO::PARAM_INT);
 try {
                   $this->msg = '';     
               $command->execute();
                } 
                catch(Exception $e)
            {
                        //$this->msg = substr($ex->getMessage(),0,-30);
                        $this->msg = $e->getMessage();
//                      $this->msg = substr($e->errorInfo[2],0,-30);

        }


Expected result:
----------------
PDO::__construct(): Called dbsetopt with parameter 3 NULL (severity 11) 

Actual result:
--------------
Language Name Already Exists..this custom Exception shown in my UI

(I'm Using Sql stored procedure, that procedure throw custom message use 
Raiserror command. That custom exception shown in my yii UI.)


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64161&edit=1

Reply via email to