当前位置: 代码迷 >> PHP >> phpMyAdmin平添存储过程
  详细解决方案

phpMyAdmin平添存储过程

热度:84   发布时间:2016-04-28 23:40:55.0
phpMyAdmin添加存储过程

存储过程:

?

CREATE PROCEDURE `ClearCoupon`()BEGIN     declare today int(16);            select UNIX_TIMESTAMP(curdate()) into today;          UPDATE coupon SET status=0 WHERE endtime<today;END;

?

?copy到phpmyadmin里面执行,就报错了

错误

SQL 查询:

CREATE?PROCEDURE?`ClearCoupon`?(?)?BEGIN?declare?today?INT(?16?)?;

MySQL 返回:文档

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3?

解决办法:
存储过程的语法是没错的,出问题的是 语句界定符";"
只需要把phpmyadmin的sql输入框下面的 "语句界定符"改为"//"就OK了


?

  相关解决方案