D
D
Dmitry Bay2015-01-29 19:08:04
MySQL
Dmitry Bay, 2015-01-29 19:08:04

How to remove an exception when requesting a database in yii?

there is PDO yii.
There is a code:

$sql = "select * from authorization(:login, :anketa, :edrpoy);";

        $connection=Yii::app()->dbpg;
        $command=$connection->createCommand($sql);
        $command->bindParam(":anketa",$login['anketa'],PDO::PARAM_STR);
        $command->bindParam(":login",$login['login'],PDO::PARAM_STR);
        $command->bindParam(":edrpoy",$login['edrpoy'],PDO::PARAM_STR);
        $dataReader=$command->queryRow();

So, if the sql line is not correct, then an exception is thrown. is it possible to bypass the exception and get the error into a variable?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Bond, 2015-01-30
@kawabanga

Try/Catch to help you.
But such requests must be made through AR.

A
Alexey Sklyarov, 2017-08-24
@Daniel_Defo

https://jsfiddle.net/ppmugw7y/1/
Play around with the skew() parameter. I’ll clarify right away that if you rotate a block by a certain degree, you will need to rotate the child block by the opposite degree. You will see it in the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question