I want to update a table from a select result , I couldn't find similar to findbysql
I create a model Last_point but I couldn't use it with the calass that I found in the help , updateByPK.....
$modelSensor = SensorInfo2::model()->findBySql('SELECT * FROM information_sensors where sensors_id=
"'.$s['sensors_id'].'" ; ');
$sResult = array(intval($modelSensor->information_time ),intval($modelSensor-
>information_value ));
foreach ($modelSensor as $up) // for each value that I get from previous query
I want to use it to update a row in another
table
{
// what I have to put here
'UPDATE last_point SET last_point_info = "'.$up['information_time'].'"'
}
$json = CJSON::encode($sResult);
echo $json ;
Yii::app()->end();
the result of my select query will be used also.
Many thanks in advance

Help













