From the course: Learning phpMyAdmin

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Creating a stored procedure

Creating a stored procedure

From the course: Learning phpMyAdmin

Start my 1-month free trial

Creating a stored procedure

- PhpMyAdmin has a useful dialogue box that simplifies creating and editing stored procedures. To create a stored procedure, you must first select the database. We're working with up_and_running, so I'm going to select that in the panel on the left. And then it's the Routines tab at the top right that we need to select. Routines is for both stored procedures and stored functions. So under New, click Add routine, and it opens this dialogue box. We need to give it a name, so I'm going to call it show_discount. And type, by default, is set to procedure. This is also used for stored functions, we'll look at that in the next video. So leave that at procedure. Then we can set parameters. First you set the direction of the parameters, in, out, or in out. I'm going to create an in parameter, and I'm going to call it p_rate. And then we need to set the data type. Rather than integer, I want to have it as a float. We don't need to add anything in the length/values field. Then we need to select…

Contents