我正在尝试使用以下代码创建一个简单的存储过程:
<? php
$PROCEDURE_TEST = 'CREATE PROCEDURE TEST1 BEGIN SELECT * FROM PRODUCTS; END';
$query = mysqli_query($db_conx, $PROCEDURE_TEST);
if ($query === TRUE) {
echo "<h3>PROCEDURE_TEST created OK :) </h3>";
} else {
echo "<h3>PROCEDURE_TEST NOT created :( </h3>" . mysqli_error($db_conx);
}
?>
它出现以下错误:
“您的SQL语法有错误;请查看与您的MySQL服务器版本对应的手册,以便在'BEGIN AS SELECT * FROM PRODUCTS; END'第1行附近使用正确的语法”
语法错误是什么?