I’ve run into an error when executing a query. I get the following error when trying to run a select.
[sql]SQLSTATE[HY000]: General error
I’m using the following to run the query:
$command = Yii::app()->db->createCommand($sql); $dataReader=$command->query(); $avs=$dataReader->readAll();
The query consists of setting two User-Defined Variables, then a select statement. Like this:
SET @start= null;
SET @end = null;
select … from …;
Am I using the right syntax for running that query? Any other thoughts?
EDIT: I know the query is ok. When I run it in my mysql application, it works fine.