Search code examples
mysqlsqlprepared-statementparameterized

How to set query parameters in MySQL Query Browser?


Can the MySQL Query Browser set parameters of a parameterized query? If so, how? I tried populating the Parameter Browser tab but it doesn't seem to actually set parameters when I execute the query.

I searched for quite a while in Google (e.g. mySQL Query Browser parameterized) but had no luck finding the answer.

I found this thread on the mySQL forums-- sounds like I'm not the only one scratching my head here.

I'm using Version 5.1 on Windows Server 2008 (client and server), if that matters.


Solution

  • To use parameters in Query Browser, the query has to be written like this:

    select * from table where id=:id
    

    If a parameter with the name 'id' exists in the parameter browser, the query will run.