It was an intriguing problem and took quite a bit of research on Internet before I could find a solution. The solution is to use the PREPARE statement. Here is the code that worked (I am truncating the CREATE TABLE and INSERT INTO statements to make it easier to read): Passing the table name as variable to CREATE TABLE, INSERT INTO and DROP TABLE (and probably a lot of other) statements will not work. Prepared statements are the way out. Hope this would be of help to someone! Please feel free to ask me if you have any questions. I will be happy to try and help you. Thank you for using TechWelkin. Comment * Name * Email * Website

Δ