<?php
/********************************************
InstallDatabase.php
This script will create the required MySQL
Table for use with the News System.
*********************************************/
/**
* Connect to DB here!!
*/
// Import Database settings etc.
require('config.php');
$connection = mysql_connect($db_host, $db_user, $db_password)
or die("Unable to connect to MySQL");
mysql_select_db($db_name, $connection) or die("Unable to select DB!");
$sql = 'CREATE TABLE `newstbl` ('
. ' `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, '
. ' `author` VARCHAR(30) NOT NULL, '
. ' `content` TEXT NOT NULL, '
. ' `date` DATE NOT NULL'
. ' )'
. ' ENGINE = myisam;';
if(mysql_query($sql))
{
echo "Table created, Success!";
}
else echo "Error creating table! Maybe you forgot to edit the config file?!";
mysql_close($connection);
?>
|