Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Should simply include config.php, however using post/get
- // for these 4 variables below will do better, mainly
- // since we want to only install if config.php doesn't exist.
- $host = "127.0.0.1"; //What is the local host of your database?
- $username = 'root'; //What username will be used to access the database?
- $password = ''; //What is the password to access your database?
- $db = "interforum"; //What is the name of the database?
- mysql_connect($host,$username,$password);
- @mysql_select_db($db) or die( "You have supplied invalid database information.");
- // Create the database we are going to use.
- mysql_query("CREATE DATABASE IF NOT EXISTS <?php echo $db ?>");
- // Create table set 1, on the database we are using.
- mysql_query("CREATE TABLE IF NOT EXISTS `forum_activations` (
- `code` text COLLATE utf8_unicode_ci NOT NULL,
- `username` varchar(20) COLLATE utf8_unicode_ci NOT NULL
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci");
- // Create table set 2, on the database we are using.
- mysql_query("CREATE TABLE IF NOT EXISTS `forum_catagories` (
- `title` text COLLATE utf8_unicode_ci NOT NULL,
- `desc` text COLLATE utf8_unicode_ci NOT NULL,
- `position` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`position`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1");
- // Create table set 3, on the database we are using.
- mysql_query("CREATE TABLE IF NOT EXISTS `forum_replys` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `topicid` int(11) NOT NULL,
- `date` text COLLATE utf8_unicode_ci NOT NULL,
- `message` text COLLATE utf8_unicode_ci NOT NULL,
- `posterid` int(11) NOT NULL,
- `deleted` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1");
- // Create table set 4, on the database we are using.
- mysql_query("CREATE TABLE IF NOT EXISTS `forum_topics` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `forum` text COLLATE utf8_unicode_ci NOT NULL,
- `subject` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
- `message` text COLLATE utf8_unicode_ci NOT NULL,
- `date` text COLLATE utf8_unicode_ci NOT NULL,
- `posterid` int(11) NOT NULL,
- `deleted` int(11) NOT NULL DEFAULT '0',
- `type` int(11) NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1");
- // Create table set 5, on the database we are using.
- mysql_query("CREATE TABLE IF NOT EXISTS `forum_users` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `username` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
- `password` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
- `email` text COLLATE utf8_unicode_ci NOT NULL,
- `displayname` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
- `ip` text COLLATE utf8_unicode_ci NOT NULL,
- `rank` int(11) NOT NULL DEFAULT '1',
- `signature` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
- `admin` int(11) NOT NULL DEFAULT '0',
- `picture url` text COLLATE utf8_unicode_ci NOT NULL,
- `posts` int(11) NOT NULL,
- `joindate` text COLLATE utf8_unicode_ci NOT NULL,
- `activated` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1");
- mysql_close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement