How to write a stored procedure in phpMyAdmin?

You can easily create procedures in phpMyAdmin.

  1. Go to your database. Click 'Routines' tab in header
  2. Click on 'Add routine'

enter image description here

  1. Then a popup window will be opened. In that write your procedure and click on "GO"

For example like follows. enter image description here

That's it. You can view your created procedures under 'Routines' tab itself.

enter image description here


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.

enter image description here

Also you can refer this: http://www.mysqltutorial.org/mysql-stored-procedure-tutorial.aspx