How to create new Mysql database using php script? I am able to create new table using "create table abc" but unable to create database using $q="create database mydata"; $re=mysql_query($q); PHP:
Make sure on your queries you do mysql_query($query) or die('Error: '.mysql_error()); Otherwise when you have errors such as this, you have no idea why. You probably have no made a connection to the server if that isn't working, or it already exists.
Connection is ok, its showing error in query only. I have already kept or die there. Do you any code for it?
? What error are you getting? You do have mysql_select_db() right? Not sure what "do you any code for it" means. It's simple "create database <name>".