mysqli schedule time错误:未添加到表中

a8jjtwal  于 2021-06-21  发布在  Mysql
关注(0)|答案(1)|浏览(329)
default command time schedule

CREATE EVENT event_name
ON SCHEDULE
EVERY {x}
{SECOND | MINUTE | HOUR | DAY | MONTH | YEAR | WEEK}
DO
{SQL COMMAND};

我自己的活动

$auto = "CREATE EVENT event_name
ON SCHEDULE
EVERY 50 second
DO
INSERT into mytable (id, account, date)
          VALUES('$id', '$account','$date'  )";             

  if(mysqli_query($conn, $auto)){ 
                                                 echo '<script>alert("Data success to save !")</script>';
                                                }
                                                else{
                                                echo '<script>alert("Data failed to save !")</script>';
                                                }           
;

代码应该可以正常工作,但查询没有添加到mysql表中
我错过了什么?

4dc9hkyq

4dc9hkyq1#

你应该跑 SET GLOBAL event_scheduler = ON; 在mysql中启动预定事件。为了阻止它,请退出 SET GLOBAL event_scheduler = OFF;

相关问题