dzhax Posted July 26, 2009 Share Posted July 26, 2009 NVM FIGURED IT OUT ON MY OWN Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted July 26, 2009 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 Share Posted July 26, 2009 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 Link to comment Share on other sites More sharing options...
justsomeguy Posted July 27, 2009 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
Archived
This topic is now archived and is closed to further replies.