Location: PHPKode > projects > SWG MiniBlog > sub/setup.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="de">
<?php	
	/* load configuration options */
	require("config.php");
	/* connect to MySQL database */
	mysql_connect($mysql_host, $mysql_user,$mysql_pass) or die("Keine Verbindung zum MySQL Server moeglich.");
  mysql_select_db($mysql_db) or die("Die Datenbank existiert nicht.");
  /* load predefinded functions */
	require("functions.php");
?>
<head>
<title><?php echo $page_title; ?></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style type="text/css">
@import url("css/layout.css");
@import url("css/color.css");
</style>
</head>
<body>	
<?php
	$sql_query = <<<EOF
CREATE TABLE `{$mysql_blog_table}` (
`id` INT NOT NULL AUTO_INCREMENT,
`time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`entry` TEXT CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`tags`	VARCHAR,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM CHARACTER SET latin1 COLLATE latin1_general_cs;
EOF;
	$sql_reply = mysql_query($sql_query);
	$sql_query = <<<EOF
CREATE TABLE `{$mysql_comments_table}` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`post_id` INT NOT NULL,
`username` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL DEFAULT 'Anonymous',
`comment` TEXT CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL
) ENGINE = MYISAM ;
EOF;	
	echo("Setup of the MySQL tables was successful if MySQL returns 1..<br />\nIt actually returned {$sql_reply}.<br />\nIf everything went OK, you can follow <a href=\"../{$page_self}?action=login\">this link</a> to the blog..<br />\nCheck the settings in the sub/config.php file if you still get errors..");
?>

Return current item: SWG MiniBlog