Thursday, May 8, 2008

PHPAdmin does not allow Stored Procedures

I tried very hard to add stored procedures to my MySQL database that is being served on my webserver. I converted my code from the SQLServer code I have gotten more used to writing (until 5.0 MySQL had no stored procedures) the syntax is not quite the same but close enough to just iron out the kinks and throw it into MySQL ... or so I thought. I removed all the syntax changes I saw needed from the MYSQL 5.0 Manual (which is a nice resource) well I was going into one of those pits where you know something is wrong and the fix is not obvious. I assumed it might be the fact I needed to change the delimiter so I tactfully added "DELIMITER ?" which did not help at all. I could tell this was the problem though something was wrong with the delimiter because I would get a slight change in some functions removing verses adding the semicolons. Finally I searched "PHPADMIN STORED PROCEDURES" on google and I found what I needed it was right there on the site the whole time but not placed very tactfully in my case. The solution was staring me in the face at the bottom of the PHPADMIN page, in the bottom under the SQL syntax textbox was a textbox labeled delimiter with a semicolon in it. I changed that to \\ because that is what the post suggested and violas. Stored procedure added.

No comments: