In order to help programmers optimize and troubleshoot their queries more efficiently, the MySQL Query Browser can copy queries from application code using your favorite integrated development environment (IDE).
This functionality is only available for the Windows version of MySQL Query Browser.
The following PHP code will be used as an example:
$SQL = "SELECT Id, Name, Country FROM City" . "WHERE Name LIKE $cityname";
To copy the listing into the MySQL Query Browser, copy the block of code (including the assignment portion), right click within the query area of the MySQL Query Browser, and choose the Paste Clipboard Content as PHP Code option. The nonquery portions of the highlighted area will be stripped and the query will be pasted into the query area.
The dynamic elements of the query are converted into local parameters, visible in the parameter browser:
SELECT Id, Name, Country FROM City WHERE Name LIKE :cityname
To set the value of a local parameter, highlight the value in the parameter browser and press F2. You can also double-click on the value to edit it. The value you assign will be used when the query is executed.
After editing the query, right-click within the query area and choose the Copy Query as PHP Code option. The surrounding PHP code will be re-inserted along with the modified query. This functionality allows you to edit queries quickly while programming.