Update Database By Clicking A Button

Hello everyone!

The situation is described below (picture)

3860

Capture.PNG

After clicking on button with label +, the driver_point column’s value that comes from a database table is updated (1 is added to point) somewhat and the interface must still be looking the same.

The first choice is to use sql queries inside javascript like this link. But that is a bad practice and not recommended to use as security reason.

The second is to use server-side language in this case is PHP. I’m just new to Yii and PHP so could you tell me a way to achieve my goal.

Best regards.

Hung

You can use:


CHtml::ajaxSubmitButton('Save','your-url',array())

‘your-url’ is some action in controller

Yes, it works. Thank you.