How to write a stored procedure in phpMyAdmin?
You can easily create procedures in phpMyAdmin.
- Go to your database. Click 'Routines' tab in header
- Click on 'Add routine'
- Then a popup window will be opened. In that write your procedure and click on "GO"
For example like follows.
That's it. You can view your created procedures under 'Routines' tab itself.
In phpMyAdmin you can create the stored procedure in the SQL window.
You may have to set the delimieter to something like "$$" instead of the default ";". You can change this from the bottom of the SQL window.
Also you can refer this: http://www.mysqltutorial.org/mysql-stored-procedure-tutorial.aspx