Закладки

Примітка

Вам потрібно налаштувати Зберігання конфігурації phpMyAdmin для використання функцій закладок.

Зберігання закладок

Any query that is executed can be marked as a bookmark on the page where the results are displayed. You will find a button labeled Bookmark this query just at the end of the page. As soon as you have stored a bookmark, that query is linked to the database. You can now access a bookmark dropdown on each page where the query box appears on for that database.

Перемінні всередині закладки

Inside a query, you can also add placeholders for variables. This is done by inserting into the query SQL comments between /* and */. The special string [VARIABLE{variable-number}] is used inside the comments. Be aware that the whole query minus the SQL comments must be valid by itself, otherwise you won’t be able to store it as a bookmark. Also, note that the text „VARIABLE“ is case-sensitive.

Коли ви виконуєте закладку, всі введені в поля вводу Змінні на сторінці вікна запиту замінять рядки /*[VARIABLE{variable-number}]*/ у вашому збереженому запиті.

Також пам’ятайте, що все інше в рядку /*[VARIABLE{variable-number}]*/ для вашого запиту залишатиметься таким, яким він є, але буде позбавлений символів /**/. Так що, ви можете використовувати:

/*, [VARIABLE1] AS myname */

що буде розширено до

, VARIABLE1 as myname

у вашому запиті, де VARIABLE1 - це рядок, який ви ввели в поле введення змінної 1.

Більш складний приклад, скажімо, ви зберегли цей запит:

SELECT Name, Address FROM addresses WHERE 1 /* AND Name LIKE '%[VARIABLE1]%' */

If you wish to enter «phpMyAdmin» as the variable for the stored query, the full query will be:

SELECT Name, Address FROM addresses WHERE 1 AND Name LIKE '%phpMyAdmin%'

NOTE THE ABSENCE OF SPACES inside the /**/ конструкція. Будь-які пробіли, введені до нього, пізніше будуть також вставлені як пробіли у вашому запиті і можуть призвести до неочікуваних результатів, особливо при використанні розширення змінної всередині виразу «LIKE „“.