Is there any way in MySQL to put the name of the database into a variable? For example, when I have a database called \'db1\', can I do something like this:
If you have PHP installed you could use this script to replace the mysql variables to there actual value: