我用mysqli的面向過程方法建立預存程序
<?php
$con = mysqli_connect('localhost', 'root', 'password', 'test');
if(mysqli_connect_errno($con)){
return mysqli_connect_error;
}
$sql = "
CREATE PROCEDURE pro1(IN title varchar)
BEGIN
DELETE FROM user WHERE username=title;
END;
";
mysqli_query($con, $sql);
mysqli_close($con);
儲存程序並沒有被創建,請問這是怎麼回事?
我把sql語句複製到phpmyadmin裡面一切正常·
把錯誤打出來看看