Jump to content

Sending Sql Statements


dzhax

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...