Can anybody tell me how to write an updte query using DAO. Its not explained in the documentation.
My code is as follows:
$connection=Yii::app()->db;
$jc_id=$_GET['id'];
$state=$_GET['state'];
$sql='update job_cards set status =:status where jc_id=:jc_id';
$command->bindParam(":status",$state,PDO::PARAM_STR);
$command->bindParam(":jc_id",$jc_id,PDO::PARAM_STR);
$command=$connection->createCommand($sql)->execute();
This code gives as error
Fatal error: Call to a member function bindParam() on a non-object in G:\xampp\htdocs\testyii\damodar\protected\controllers\JobCardsController.php on line 136
hello, i’m trying to use this update method to store a float value but instead of writing the correct value it always convert it to “1,000…” … if i change the datatype in db from float to varchar storing is correct