From the course: Learning phpMyAdmin

Unlock the full course today

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

Using a variable with a bookmarked query

Using a variable with a bookmarked query

From the course: Learning phpMyAdmin

Start my 1-month free trial

Using a variable with a bookmarked query

- Bookmarks are convenient for storing frequently used queries but you might not always want to run exactly the same query. phpMyAdmin let's you construct a bookmark query that accepts a variable to change a condition or value. You do so by embedding an SQL comment inside a query. A couple of examples should show you how it works. I'm in the Up and Running database and have selected the SQL tab. In the previous video we created some bookmarked queries so I'm going to use one of those to start off with. So from bookmarked SQL query I'm going to select Budget Cars, then the View only radio button, and click Go, and that is loaded my bookmarked query into the query box. I'm going to put the variable in the WHERE clause so we need to wrap the WHERE clause in a SQL comment. And SQL comments use the same tags as CSS so just before "WHERE" we need to insert a slash and an asterisk, and then at the end of the WHERE clause, another asterisk and a slash. So, this turns the WHERE clause, the…

Contents