更新时间:2023-11-30 11:46:04
You most likely do not need the DELIMTER
command. That belongs to MySQL-centric client programs.
Please try with plain old semicolons:
if (!$mysqli->query("DROP PROCEDURE IF EXISTS p") ||
!$mysqli->query("CREATE PROCEDURE p(IN id_val INT) BEGIN INSERT INTO test(id) VALUES(id_val); END;")) {
echo "Stored procedure creation failed: (" . $mysqli->errno . ") " . $mysqli->error;
}
and let PHP worry about delimiting
I got the above code from http://php.net/manual/en/mysqli.quickstart.stored-procedures.php