faces3 Posted April 9, 2013 Share Posted April 9, 2013 Hey! Need script with webform where i put database name. Username and password and it create new mysql database. I dont want do it phpmyadmin. I want do it in website. I try and try all different things but it dont work. Can someone help me ? Is it possible to do that? Thanks for help! Quote Link to comment Share on other sites More sharing options...
Solution xxclear Posted April 9, 2013 Solution Share Posted April 9, 2013 It is possible but can i ask why? It would only work once as you can only have one database connected to website at any one time. are you sure you don't want to just create a new table? <?php $con=mysqli_connect("example.com","peter","abc123"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // Create database $sql="CREATE DATABASE my_db"; if (mysqli_query($con,$sql)) { echo "Database my_db created successfully"; } else { echo "Error creating database: " . mysqli_error(); } ?> as taken from W3C schools You would need to create an input form and use POST if you want it to be user controlled, Quote Link to comment Share on other sites More sharing options...
faces3 Posted April 9, 2013 Author Share Posted April 9, 2013 I want create install file first is form where put folder name and then unzip files to that folder. Then create new database and tables. And then create subdomain for that folder name. That script need own files and database to all subdomain. And i want i can do allthing in website install file. Just open www.domain.com and i can do allthing there. Dont need lgin phpmyadmin. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.