0

Is there any way in yii to get the array of the parameters passed in createCommand?

     $countSQL= 'my sql query ';
     $command = Yii::app()->db->createCommand($countSQL);   
     $command->bindValue(":param1",'%'.$param1.'%');
     $command->bindValue(":param2",'%'.$param2.'%');
     $command->queryAll();

I want to know if it there is any way to get the array which will be similar to

array(
 ":param1" => '%'.$param1.'%',
 ":param2" => '%'.$param2.'%',
)
1

1 Answer 1

1

You can get those parameters but only with extending some library files like PDO Connection and CDbCommand.

In my project, I had created extended CPdoConnection and CDbCommand.

I had code for you, let me know if you need it.

Regards, Sanjay

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.