By all means your not being mean...
I am learning php as I go, so forgive me if I seem ignorant or if this is a foolish question.
Lets say I change the code from:
//Get data from setup.php form
$localhost=$_POST['localhost'];
$user_name=$_POST['user_name'];
$password=$_POST['password'];
$username=$_POST['username'];
$userpass=$_POST['userpass'];
$level="1";
to manually inserting the values:
new code:
//Get data from setup.php form
$localhost="localhost";
$user_name="mydatabaseusername";
$password="mydatabasepassword";
$username=$_POST['username']; // this I can leave becuase it does nothing but inserts a value into one of my fields
$userpass=$_POST['userpass']; // this I can leave becuase it does nothing but inserts a value into one of my fields
$level="1";
// Connect
$con = mysql_connect("$localhost","$user_name","$password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// Create database
if (mysql_query("CREATE DATABASE audio",$con))
{
echo "Audio Database has been created<br>Remove files: setup.php and configdb.php from your directory";
}
else
{
echo "Error creating database: " . mysql_error();
}
// Create first table called music
mysql_select_db("audio", $con);
$sql ="CREATE TABLE `music` (
`id` int(4) NOT NULL auto_increment,
`month` varchar(4) NOT NULL default '',
`day` varchar(4) NOT NULL default '',
`year` varchar(4) NOT NULL default '',
`title` varchar(90) NOT NULL default '',
`group` varchar(30) NOT NULL default '',
`file` varchar(60) NOT NULL default '',
PRIMARY KEY (`id`))";
mysql_query($sql,$con);
mysql_select_db("audio", $con);
// Create second table called admin
$sql ="CREATE TABLE `admin` (
`id` int(4) NOT NULL auto_increment,
`username` varchar(65) NOT NULL default '',
`userpass` varchar(65) NOT NULL default '',
`level` int(4) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=2";
mysql_query("INSERT INTO `admin` VALUES ('id', '$username', '$userpass', '$level')") ;
mysql_close($con);
?>
I'm don't know what do with the if statement - Where it should go at the end and how it should be written to include the whole process.