mysql - Problems with creating stored procedures in php
phpcn_u1582
phpcn_u1582 2017-06-07 09:23:11
0
1
907

I use mysqli's process-oriented method to create stored procedures

<?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);

The stored procedure has not been created. What's going on?

I copied the sql statement into phpmyadmin and everything was fine·

phpcn_u1582
phpcn_u1582

reply all(1)
左手右手慢动作

Type out the errors and see

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template