bindParam() in Yii coerces the parameter's type to a string when there are several queries
try bindValue()
The bindParam() and bindValue() methods are very similar. The only difference is that the first binds the parameter to a reference to a PHP variable, while the second binds it to a value. For parameters that represent a large amount of data, it is preferable from a performance standpoint to use the bindParam() method.
$connection = Yii::app()->db;
$sql2="SELECT ****111" ;
$command = $connection->createCommand($sql2);
$command->bindValue(":limit", $limit, PDO::PARAM_INT);
$rawData = $command->queryRow();
$sql = " SELECT ***22";
$command2 = $connection->createCommand($sql);
$command2->bindValue(":limit", $limit, PDO::PARAM_INT);
$rawData = $command2->queryAll();
Comments