Jump to content

Sending Sql Statements


dzhax
 Share

Recommended Posts

Guest FirefoxRocks

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

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 by dzhax
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...