Hi alll,
Can anybody tell me how to write an updte query using DAO. Its not explained in the documentation.
My code is as follows:
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
Please advice what to do.
Thanks
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
Please advice what to do.
Thanks