ok this is what i ulered:
<?php
//create variables for a connection to the database
$host='localhost'; //this is normally OK
$user='TEST'; //this is the default (root) for a new install of MySQL
$password='TEST'; //this is the default
//Connect to the server (MySQL server) this is the first thing you must do
$connect=mysql_connect($host,$user,$password)
or die("Could not connect to server, MySQL said: ".mysql_error());
//Now create a database on the server using PHP
$db=mysql_query("TEST");//This sets up the query
//Now select to use the database (mydatabase)
$db2 =mysql_select_db('TEST')//This executes the query set up by the
//you dont need to edit beyond this point
or die("Could not select the new database. MySQL said: ".mysql_error());
//Now set up a new query to create atable on the new database (mydatabase)
$table="CREATE TABLE `hompage` (
`id` int(6) NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`content` varchar(255) NOT NULL default ,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;''
$maketable=mysql_query($table,$connect);//This executes the table creation defined above.
//now set up a query to insert data in to mytable
$insert ="INSERT INTO hompage (title,content) VALUES ('test test test test test','test test test test test test')";
//execute the query
$result =mysql_query($insert)
or die("Query failed. MySQL said: ".mysql_error());//kill script and print errors if they occur
//Set up a query to show the all data in mytable right now
$query2 ="SELECT * FROM mytable";
//execute the query below
$result2 =mysql_query($query2)
or die("Query failed. MySQL said: ".mysql_error());
?>
ok im still learning php but I dont know about the table if I put all i need to in the right place there is also an error
Parse error: syntax error, unexpected T_STRING in /home/mystrh00
/domains/witchin.net/public_html/layout/cms/install.php on line 41
i dont know can someone help me.
and also I already have a connection to my DB. so is there a way i can use and include to connect so people dont have to fill out 2 DB connections.
heres the code if there is a way then tell me if I need to add something or not:
<?php
/// For the following details,
/// please contact your server vendor
$hostname='localhost'; //// specify host, i.e. 'localhost'
$user='mystrh00_content'; //// specify username
$pass='803161'; //// specify password
$dbase='mystrh00_content'; //// specify database name
$connection = mysql_connect("$hostname" , "$user" , "$pass")
or die ("Can't connect to MySQL");
$db = mysql_select_db($dbase , $connection) or die ("Can't select database.");
?>