View with variables in PHPMyAdmin

I use PHPmyadmin to create and view views. I want to have views that accept a variable, so I can use different values ​​without creating a new query.

Here is an example of when I will use this.

If I have a query that searches for people at a certain age:

SELECT Name FROM tbl_people WHERE age < 30; 

Is there a way to make value (30) dynamic so that I can change it on the fly? I think phpmyadmin is asking for a value before displaying the view, or maybe there is an input field to change the value.

Not sure if this is possible, but any help is appreciated.

+4
variables mysql view phpmyadmin
source share
2 answers


With phpMyAdmin, if the "phpMyAdmin configuration repository" is activated, you have access to create a bookmark, which is a request that can take a parameter. This query can make a SELECT from a view.

+2
source share


No, this is not possible with 'View'

You need a MySql procedure, and then call it as a request in phpmyadmin .. something like:

 CALL peopleByAge(30); 

I'm not sure if there is something like a plugin or something to call the repository procedure in phpmyadmin using the HTML form

Hope this helps

+3
source share

Source: https://habr.com/ru/post/1502419/


All Articles