How can I delete records in yiiframework when users logged-out in Whosloggedin model by column username?
table – whosloggedin
CREATE TABLE `erc_whosloggedin` (
`id` int(11) DEFAULT NULL,
`username` varchar(50) DEFAULT NULL,
`complete_name` varchar(95) DEFAULT NULL,
`date` date DEFAULT NULL,
`time` time DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
I Have tried something like this
$whosloggedin=Whosloggedin::model()->find($users->username);
$whosloggedin->delete();
Parameters passed to find function is wrong.
In Find function we have to pass $condition & $params parameters, by default $condition is an empty & $params is an empty array.
You solution would be: