I have a backup file (.sql.gz) and I want to import it to my empty database on localhost programmatically like how phpmyadmin does, inside a browser with php/mysql/javascript and not via command line. Since it's my localhost, security is not really a concern, I just want to automate a task I have to perform regularly when developing.
There are a bunch of questions here but they all deal with command line solution.
edit: I already have a xampp installation. But the whole procedure is tedious, I have to first delete the database, then recreate it and then import my data. I have to move b/w previous database backus fairly often. So I want to automate the process. I just give in the backup .sql.gz file via html form input and it does all of the above automatically.