Function name must be a string - during save();

Hello,

when i am attempting to save my record, i am getting this error.,

Function name must be a string in /data/inetpub/wwwroot/sp/protected/controllers/LifeController.php on line 117

Line 117 is this .

$activity()->save();

I am saving to a table in MYSQL whose structure is like this

 * @var integer $ID


 * @var integer $USERID


 * @var integer $ACTIVITYID


 * @var date $ONDATE


 * @var integer $TIMESPENT

and i am setting the date as

$activity->ONDATE = date("Y-m-d");

thanks

Arvind

first thought: try to rename your column ondate as it seems to be interpreted as a event assignment, avoid ‘on’ in your column names

Change it to




$activity->save(); 



(No brackets)