MySQL Forums :: PHP :: DROP PROCEDURE return error


Advanced Search

DROP PROCEDURE return error
Posted by: Yoni Gol ()
Date: October 15, 2009 01:06PM

<?php
$con = mysql_connect('localhost','root','**********');
mysql_select_db('******');

$query = "
DROP PROCEDURE IF EXISTS func;
CREATE PROCEDURE func (OUT ver INT)
BEGIN
SELECT 5 INTO ver;
END
CALL func(@a);
SELECT @a;
DROP PROCEDURE func;";

$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
mysql_close($con);
?>

When I run the script I get this error:
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 '; CREATE PROCEDURE func (OUT ver INT) BEGIN SELECT 5 INTO ver; END CAL' at line 1

help please :D

Options: ReplyQuote


Subject Written By Posted
DROP PROCEDURE return error Yoni Gol 10/15/2009 01:06PM
Re: DROP PROCEDURE return error Peter Brawley 10/15/2009 03:32PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.