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 variables with bookmarks in phpMyAdmin 4.5

Using variables with bookmarks in phpMyAdmin 4.5

From the course: Learning phpMyAdmin

Start my 1-month free trial

Using variables with bookmarks in phpMyAdmin 4.5

- phpMyAdmin 4.5 introduced support for embedding multiple variables in a bookmark, so the procedure is slightly different. I've selected the SQL tab for the up and running database in phpMyAdmin 4.5 and the first thing to note is that in the Bookmarked SQL query section at the bottom, there's no input field for variable. That's because phpMyAdmin needs to know how many input fields to create. Let's beginning by creating a bookmark with just one variable. I'm going to base this on an existing bookmark, Budget Cars, we'll select View Only, then click Go to load the bookmark. As in earlier versions of phpMyAdmin, you embed the section of the SQL query that contains a variable in an SQL comment. I'm going to wrap the WHERE clause in comment tags and search by make. Just before WHERE, opening comment tag. After the value, a closing comment tag. Then we change price to make, make it equals and the value is a string so it needs to be inside quotes and the variable needs to be inside square…

Contents