/bin/php /home/nginx/html/pet/index.php Crond/test<br /><br />#上面是shell脚本执行 crond下面的test方法
1: Is there a primary key set for ID in your data table? If $id is the same value every time you insert it, the insertion will definitely fail. Set the id to auto-increment, delete $data['id']="$id"; and take a look first.
2: $oline = M("Oline");
$data["id"] = "$id";
$data["to"] = "$to";
$data["time"] = "$t";
$data["ip"] = "$_ip";
$oline->add($data);
echo $oline- >getlastsql();exit;
Copy the output sql statement directly to mysql and execute it to see what the cause of the error is
If it is simple, you can first write a class, execute some verification methods in this class, and then let the class you execute inherit from this class.
Actually, as you mentioned, there is an example in thinkphp that better meets your requirements
It’s called RBAC, which means permission control management
You can download the example on the official website, under the Example file Yes, that is: RBAC
As for the specific usage method, I recommend you watch this video, it is very detailed, step by step, and you’re good to go! !
www.tudou.com/programs/view/YyfoP5pzdBo/