Hello everyone!
In a view I use this snippet:
<?php
echo CHtml::ajaxSubmitButton (
' ++ ',
array('/searchDriver/increasePoint'),
array(
'type'=>'POST',
'data' => array('id' => $someValue)
)
);
?>
in searchDriverController I have an action like this:
public function actionIncreasePoint()
{
$connection = yii::app()->db;
$sql = "UPDATE xeom_driver SET driver_point = driver_point + 1 WHERE driver_id = ".$_POST['id'].";";
$command=$connection->createCommand($sql);
$command->execute();
}
The weird thing happens here is that: the value of driver_point is not increased by 1. In fact it’s increased by 2.
I know that the sql is working. For example if I set driver_point to some value.
Has anybody faced this situation and have explanation ?
Thanks in advanced!