Location: PHPKode > projects > iBWd News > news/admin/install.php
<?

/*###############################################################*\
##                       iBWd News 1.1b                          ##
##                 http://bramstart.be/ibwds                     ##
##                                                               ##
*/###############################################################*\


               ########### INSTALL FILE ############
               # once installed, delete this file! #
               #####################################
require("config.php");
?>
<html>
<head>
<title>iBWD News [install mysql tables]</title>
<style>
<?=$style;?>
</style>
</head>
<body>
<h3 align="center">iBWD News [install mysql tables]</h3>
<br>
<br>
<center>
<?
if(!isset($install)){
	echo"<b><a href=\"?install=1\">Install now >></a></b>";
}
if($install == "1"){
	// table news
	$query = "CREATE TABLE $table (
				ID int(7) unsigned DEFAULT '0' NOT NULL auto_increment,
				title varchar(20),
				date varchar(20),
				poster varchar(30),
				email varchar(30),
				news blob,
				PRIMARY KEY (ID))";
	mysql_query($query,$db);
	// table users
	$query2 = "CREATE TABLE $table_users (
				ID int(11) DEFAULT '0' NOT NULL auto_increment,
				password varchar(16) NOT NULL,
				name varchar(100) NOT NULL,
				addpost enum('Y','N') DEFAULT 'N' NOT NULL,
				modpost enum('Y','N') DEFAULT 'N' NOT NULL,
				delpost enum('Y','N') DEFAULT 'N' NOT NULL,
				status enum('ADMIN','MOD') DEFAULT 'MOD' NOT NULL,
				PRIMARY KEY (ID))";
	mysql_query($query2,$db);
	$test = mysql_query("SELECT * FROM $table");
	$test2 = mysql_query("SELECT * FROM $table_users");
	if(($test) && ($test2)){
		echo"Tables <i>$table</i> and <i>$table_users</i> created.<br><br>Go to your admin panel: <a href=\"index.php\">Click here</a>";
		echo"<br><br>Make sure you delete install.php now => security reasons!";
	}
	if((!$test) || (!$test2)){
		echo"<b>An error occured!</b><br>";
		echo"* check your mySQL settings (username, password, database,...) in config.php *";
	}
	mysql_close($db);
}
?>
</center>
<br><p align="center"><a href="http://www.ibram007.f2s.com"><font size="-2" face="Verdana">powered by iBWd scripts</font></a></p>
</body>
</html>
Return current item: iBWd News