dzhax Posted July 26, 2009 Report Share Posted July 26, 2009 (edited) NVM FIGURED IT OUT ON MY OWN Edited July 26, 2009 by dzhax Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted July 26, 2009 Report Share Posted July 26, 2009 Try this: <?phpswitch($doFunction){ case "createdb": $dbname = $_GET['dbname']; $dataquery = "CREATE DATABASE " . $dbname; $sentdata = mysql_query($dataquery) or die("Could not create database"); while($displaydata=mysql_fetch_array($senddata)) { } break;}?> Link to comment Share on other sites More sharing options...
dzhax Posted July 26, 2009 Author Report Share Posted July 26, 2009 (edited) Yea firefoxrox...I just figured that out so i was editing at the time you posted sry.After Further searching I found something but its still not working...Now what I am trying: <?php switch($doFunction){ case createdb: $conn = mysql_connect($dbip, $user, $pass); if (mysql_query("CREATE DATABASE " . $dbname,$con)){ $step = '3'; header('location: index.php?step=2&dbip=' . $dbip . '&user=' . $user . '&pass=' . $pass . '&status=Able To Connect&dbname=' . $dbname . '&dbcreated=Database Created'); } else { $step = '2'; header('location: index.php?step=2&dbip=' . $dbip . '&user=' . $user . '&pass=' . $pass . '&status=Able To Connect&dbname=' . $dbname . '&dbcreated=Database Not Created'); } break; } ?> Now its telling me that Database Not Created meaning it called the else statement Edited July 26, 2009 by dzhax Link to comment Share on other sites More sharing options...
justsomeguy Posted July 27, 2009 Report Share Posted July 27, 2009 Your MySQL user probably doesn't have permission to create a database. You can always print the error from MySQL and figure it out though. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now