|
This code does not create a table but it connects to the database, is there something wrong with the syntax i dont see it
<?
$username="username";
$password="password";
$database="database";
$hostname="hostname";
$connection = mysql_connect($hostname,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="CREATE TABLE laptop (
id int(11) NOT NULL auto_increment,
date DATE NOT NULL,
time TIME NOT NULL,
subject VARCHAR(10) NOT NULL,
headline VARCHAR(50) NOT NULL,
leader VARCHAR(200) NOT NULL,
content VARCHAR (3000) NOT NULL,
PRIMARY KEY (id))";
mysql_close();
echo "Database created";
?>
|