Answer the question
In order to leave comments, you need to log in
What is the difference between query execution through Yii and through PDO?
I was tormented by the fact that through the standard Yii connection yii \ db \ Connection, some queries are not executed, specifically - it swears at the syntax.
I made a connection directly through PDO, everything went well.
I naively thought that their query execution should be identical, but apparently not. Who knows the scenario of yii\db\Connection, can you tell us what it is? Obviously, there is some parsing of the transmitted request. What is it for? Is there a mention of this somewhere in the documentation?
$sql =
CREATE OR REPLACE FUNCTION public.test() RETURNS numeric
LANGUAGE plv8
AS $_$
{
let param = 1;
let param2 = 1 ? 2 : 0;
return 1;
}
$_$;
// выполение
$this->db->createCommand($sql)->execute();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question