Hilfe bei Datenbank Create

Batch ist das richtige Stichwort, danke @chibisuke. Da findet man in der PHP-Referenz sogar einen schönen Kommentar dazu:

PHP:
function mysql_exec_batch ($p_query, $p_transaction_safe = true) {
  if ($p_transaction_safe) {
      $p_query = 'START TRANSACTION;' . $p_query . '; COMMIT;';
    };
  $query_split = preg_split ("/[;]+/", $p_query);
  foreach ($query_split as $command_line) {
    $command_line = trim($command_line);
    if ($command_line != '') {
      $query_result = mysql_query($command_line);
      if ($query_result == 0) {
        break;
      };
    };
  };
  return $query_result;
}
 
Du kannste deine SQL-Datei einlesen.
Und dann zeile für zeile abarbeiten.

"Query was empty" -> Bestimmt weil du noch eine leerzeile darunter hast oder ähnlich.
 
Hier mein Code
Code:
CREATE TABLE IF NOT EXISTS `matzeCMS_blog` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `text` text NOT NULL default '',
  `author` varchar(255) NOT NULL default '',  
  `date` varchar(255) NOT NULL default '',
  `level` int(11),
  `likes` int(10),
  `dislikes` int(10),
  `locked` int(1),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_board` (
  `active` int(1),
  `intern` int(1),
  `level` int(11)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

CREATE TABLE IF NOT EXISTS `matzeCMS_board_abo` (
  `id` int(11) NOT NULL auto_increment,
  `topic_id` int(11) NOT NULL,
  `user` varchar(255) NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_board_posts` (
  `id` int(11) NOT NULL auto_increment,
  `topic_id` int(11) NOT NULL,
  `post` text NOT NULL default '',
  `user` varchar(255) NOT NULL default '',
  `date` varchar(255) NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_board_topics` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `description` text NOT NULL default '',
  `user` varchar(255) NOT NULL default '',
  `date` varchar(255) NOT NULL default '',
  `level` int(11),
  `locked` int(1),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_chat` (
  `active` int(1),
  `intern` int(1),
  `level` int(11)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

CREATE TABLE IF NOT EXISTS `matzeCMS_chat_content` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(30) NOT NULL default '',
  `avatar` varchar(255) default '',
  `text` varchar(255) NOT NULL default '',
  `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_chat_users` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(30) NOT NULL default '',
  `avatar` varchar(30) default '',
  `last_activity` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_comming_soon` (
  `active` int(1),
  `subject` varchar(255) NOT NULL default '',
  `message` text NOT NULL default '',
  `date` varchar(255) NOT NULL default '',
  `visitors` varchar(10) default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

CREATE TABLE IF NOT EXISTS `matzeCMS_config` (
  `menu_title` varchar(20) NOT NULL default '',
  `default_style` varchar(35) NOT NULL default '',
  `default_language` varchar(28) NOT NULL default '',
  `footer_title` varchar(255) NOT NULL default '',
  `path` varchar(255) NOT NULL default '',
  `domain_name` varchar(255) NOT NULL default '',
  `website_name` varchar(100) NOT NULL default '',
  `logo_url` varchar(255) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `gb_entries_per_site` int(11) NOT NULL ,
  `comments_per_site` int(11) NOT NULL,
  `frontpage` varchar(35) NOT NULL default '',
  `gb_wait` int(11) NOT NULL,
  `gb_on` int(1) NOT NULL,
  `contact_form_on` int(1) NOT NULL,
  `change_of_name` int(1) NOT NULL,
  `wio_on` int(1) NOT NULL,
  `max_pms` int(11) NOT NULL,
  `disable` int(1) NOT NULL,
  `editor_on` int(1) NOT NULL,
  `blog_on` int(1) NOT NULL,
  `blog_level` int(3) NOT NULL,
  `counter_on` int(1) NOT NULL,
  `faq_on` int(1) NOT NULL,
  `website_title` int(1) NOT NULL,
  `feature_list_on` int(1) NOT NULL,
  `media_site_on` int(1) NOT NULL,
  `wiki_site_on` int(1) NOT NULL,
  `comments` int(1) NOT NULL,
  `v_ai` int(1) NOT NULL,
  `v_hpi` int(1) NOT NULL,
  `v_so` int(1) NOT NULL,
  `v_ans` int(1) NOT NULL,
  `v_co` int(1) NOT NULL,
  `v_anc` int(1) NOT NULL,
  `v_mo` int(1) NOT NULL,
  `v_anm` int(1) NOT NULL,
  `v_cc` int(1) NOT NULL,
  `v_cot` int(1) NOT NULL,
  `v_cu` int(1) NOT NULL,
  `v_trash` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

CREATE TABLE IF NOT EXISTS `matzeCMS_counter` (
  `id` int(11) NOT NULL auto_increment,
  `hits` int(11),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_downloads` (
  `id` int(11) NOT NULL auto_increment,
  `path` varchar(255) NOT NULL default '',
  `filename` varchar(255) NOT NULL default '',
  `description` text NOT NULL,
  `likes` int(10),
  `dislikes` int(10),
  `hits` int(11),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_events` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `description` text NOT NULL default '',
  `place` varchar(255) NOT NULL default '',
  `author` varchar(30) NOT NULL default '',
  `from` varchar(255) NOT NULL default '',
  `to` varchar(255) NOT NULL default '',
  `likes` int(10),
  `dislikes` int(10),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_features` (
  `id` int(11) NOT NULL auto_increment,
  `feature` varchar(255) NOT NULL default '',
  `likes` int(10),
  `dislikes` int(10),
  `rating` int(10),
  `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_features_vote` (
  `id` int(11) NOT NULL auto_increment,
  `feature_id` int(11) NOT NULL,
  `vote` tinyint(1),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_gallery` (
  `active` int(1),
  `name` varchar(255) NOT NULL default '',
  `intern` int(1),
  `lightbox` int(1),
  `imageinfo` int(1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

CREATE TABLE IF NOT EXISTS `matzeCMS_gallery_categories` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `description` text NOT NULL default '',
  `author` varchar(30) NOT NULL default '',
  `level` int(11),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_gallery_images` (
  `id` int(11) NOT NULL auto_increment,
  `categorie` int(11) NOT NULL,
  `img_name` varchar(255) NOT NULL default '',
  `img_path` varchar(255) NOT NULL default '',
  `img_description` text NOT NULL default '',
  `likes` int(10),
  `dislikes` int(10),
  `visitors` int(10),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_guestbook` (
  `id` int(11) NOT NULL,
  `title` varchar(55) NOT NULL default '',
  `name` varchar(55) NOT NULL NULL default '',
  `email` varchar(55) NOT NULL NULL default '',
  `website` varchar(55) NOT NULL NULL default '',
  `text` text NOT NULL,
  `session_ip` varchar(20) NOT NULL NULL default '',
  `session_time` varchar(20) NOT NULL NULL default '',
  `date` varchar(255) NOT NULL NULL default '',
  `show_infos` int(1),
  `locked` int(1),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_menu` (
  `id` int(11) NOT NULL,
  `menu_order` int(10) NOT NULL,
  `site_id` int(10) NOT NULL,
  `title` varchar(255) NOT NULL default '',
  `link` varchar(255) NOT NULL default '',
  `ext` int(1),
  `window` varchar(15) default '',
  `level` char(1),
  `isset` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_messages` (
  `id` int(11) NOT NULL,
  `to` varchar(15) NOT NULL default '',
  `from` varchar(15) NOT NULL default '',
  `subject` varchar(255) NOT NULL default '',
  `message` text NOT NULL default '',
  `date` varchar(255) NOT NULL default '',
  `read` int(1),
  `marked` int(1),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_meta` (
  `author` varchar(100) default '',
  `publisher` varchar(100) default '',
  `rights` varchar(100) default '',
  `description` varchar(255) default '',
  `keywords` varchar(255) default '',
  `robot` int(5),
  `language` varchar(10) default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

CREATE TABLE IF NOT EXISTS `matzeCMS_newsletter` (
  `id` int(11) NOT NULL,
  `subject` varchar(255) NOT NULL default '',
  `text` text NOT NULL,
  `author` varchar(255) NOT NULL default '',
  `date` varchar(255) NOT NULL default '',
  `mailed` int(1),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_newsletter_abo` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL default '',
  `mail` varchar(255) NOT NULL default '',
  `active` int(1),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_session` (
  `id` int(11) NOT NULL,
  `session_time` varchar(30) NOT NULL default '',
  `session_ip` varchar(30) NOT NULL default '',
  `time` varchar(30) NOT NULL default '',
  `name` varchar(14) NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_shop` (
  `shop_active` int(1),
  `shop_name` varchar(255) NOT NULL default '',
  `shop_description` text NOT NULL default '',
  `shop_slogan` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

CREATE TABLE IF NOT EXISTS `matzeCMS_shop_products` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL default '',
  `description` text NOT NULL default '',
  `price` varchar(255) NOT NULL default '',
  `img_path` varchar(255) NOT NULL default '',
  `likes` varchar(10) default '',
  `dislikes` varchar(10) default '',
  `mass` varchar(10) default '',
  `avaibel` int(1),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_shop_selling` (
  `id` int(11) NOT NULL,
  `user` varchar(255) NOT NULL default '',
  `price` varchar(255) NOT NULL default '',
  `payment` varchar(255) NOT NULL default '',
  `adress` text NOT NULL default '',
  `payed` int(1),
  `product_sended` int(1),
  `controlled` int(1),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_sites` (
  `id` int(11) NOT NULL,
  `title` varchar(55) NOT NULL default '',
  `text` mediumtext NOT NULL default '',
  `first_date` varchar(255) NOT NULL default '',
  `last_date` varchar(255) NOT NULL default '',
  `author` varchar(30) NOT NULL default '',
  `level` int(11),
  `comments_on` int(11),
  `newsflash_on` int(11),
  `mediasite` int(11),
  `newssite` int(11),
  `wikisite` int(11),
  `trash` int(1),
  `trash_date` varchar(255) NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_site_categories` (
  `id` int(10) NOT NULL,
  `title` varchar(255) NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_site_comments` (
  `id` int(11) NOT NULL,
  `sites_id` int(11) NOT NULL,
  `author` varchar(30) NOT NULL default '',
  `subject` varchar(55) NOT NULL default '',
  `text` text NOT NULL,
  `date` varchar(255) NOT NULL default '',
  `likes` varchar(10) default '',
  `dislikes` varchar(10) default '',
  `locked` int(1),
  `locked_messages` varchar(255) NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_site_media` (
  `id` int(11) NOT NULL,
  `sites_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL default '',
  `text` text NOT NULL default '',
  `content` varchar(255) NOT NULL default '',
  `date` varchar(255) NOT NULL default '',
  `author` varchar(30) NOT NULL default '',
  `no_files_message` varchar(255) NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_site_news` (
  `id` int(11) NOT NULL,
  `sites_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL default '',
  `text` text NOT NULL default '',
  `date` varchar(255) NOT NULL default '',
  `author` varchar(30) NOT NULL default '',
  `likes` varchar(10) default '',
  `dislikes` varchar(10) default '',
  `locked` int(1),
  `locked_message` varchar(255) NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_site_wiki` (
  `id` int(11) NOT NULL,
  `sites_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL default '',
  `text` text NOT NULL default '',
  `date` varchar(255) NOT NULL default '',
  `author` varchar(30) NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `matzeCMS_user` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL default '',
  `password` varchar(255) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `level` int(11) NOT NULL,
  `autologin` int(1),
  `city` varchar(30) NOT NULL default '',
  `first_name` varchar(30) NOT NULL default '',
  `last_name` varchar(30) NOT NULL default '',
  `nickname` varchar(30) NOT NULL default '',
  `job` varchar(30) NOT NULL default '',
  `interests` varchar(255) NOT NULL default '',
  `street` varchar(30) NOT NULL default '',
  `plz` int(11) NOT NULL,
  `mobile` varchar(30) NOT NULL default '',
  `telephone` varchar(30) NOT NULL default '',
  `website` varchar(100) NOT NULL default '',
  `facebook` varchar(100) NOT NULL default '',
  `twitter` varchar(100) NOT NULL default '',
  `icq` varchar(10) NOT NULL default '',
  `aim` varchar(30) NOT NULL default '',
  `yim` varchar(30) NOT NULL default '',
  `gim` varchar(30) NOT NULL default '',
  `msn` varchar(30) NOT NULL default '',
  `ban` int(1),
  `session_time` varchar(25) NOT NULL default '',
  `time` varchar(5) NOT NULL default '',
  `active` char(1) default '',
  `act_key` varchar(255) NOT NULL default '',
  `ice` int(1),
  `birthday` varchar(255) NOT NULL default '',
  `birthplace` varchar(255) NOT NULL default '',
  `education` varchar(255) NOT NULL default '',
  `title` varchar(10) NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1;
Ich hoffe ihr findet Fehler. An der Struktur möchte ich nichts ändern, sonst müsste ich meine halbe CMS überarbeiten ;-)
 
Meine install.php sieht so aus:
PHP:
<?php

include "style/template/header.html";

@include "../config.php";

$connection = @mysql_connect($server, $dbusername, $dbpassword);
@mysql_select_db($dbname);

$step = $_GET['step'];
$path = $_SERVER['SCRIPT_NAME'];
$host = $_SERVER['HTTP_HOST'];
$mode = $_GET['mode'];

if (defined("MatzeCMS_INSTALLED") AND !isset($step)) {
	include "style/template/installed.html";
}

elseif (!isset($step)) {
	include "style/template/installation.html";
}

if ($step == '1') { 
	include "style/template/database.html";
	
	if (!($handle = @fopen("../config.php", w))) {
		echo "<font color='red'><b>Deine config.php ist nicht beschreibbar!</b></font>";
	} else {
		echo "<font color='green'><b>Deine config.php ist beschreibbar.</b></font>";
	}

	echo "<br /><br />";
	$_SESSION['prefix'] = $_POST['mysql_prefix'];
	echo "<input class='button' type='submit' value='Weiter' />";
	echo "</form></td></tr></table></section>";
}

if ($step == '2') {
	$server = $_POST['server'];
	$mysql_username = $_POST['mysql_username'];
	$mysql_password = $_POST['mysql_password'];
	$mysql_db = $_POST['mysql_db'];
	$mysql_prefix = $_POST['mysql_prefix'];
	if (!($handle = @fopen("../config.php", w))) {
		include "style/template/database_error.html";
	} else {
		// Let's go and write the config.php
		$write_config = "<?php\n\n";
		$write_config .= "// This is the auto-generated configuration file for your matzeCMS.\n\n";
		$write_config .= "\$server = \"$server\";\n";
		$write_config .= "\$dbname = \"$mysql_db\";\n";
		$write_config .= "\$dbusername = \"$mysql_username\";\n";
		$write_config .= "\$dbpassword = \"$mysql_password\";\n";
		$write_config .= "\$dbprefix = \"$mysql_prefix\";\n\n";
		$write_config .= "define(\"MatzeCMS_INSTALLED\", true);";
		$write_config .= "\n\n?>";
		fwrite($handle, $write_config);
		fclose($handle);
		include "style/template/database_sucess.html";
	}
}

if ($step == '3') {
	if ($connection == false) {
		include "style/template/connection_problems.html";
	}
	
	include "style/template/configuration.html";
}

if ($step == '4') {
	$contents = file_get_contents("mysql/install.sql");

	$sqls = explode(';', $contents);

	foreach($sqls as $sql)
	{
	  mysql_query($sql) or die (mysql_error());
	}
	
	$contents2 = file_get_contents("mysql/insert.sql");

	$sqls2 = explode(';', $contents2);

	foreach($sqls2 as $sql2)
	{
	  mysql_query($sql2) or die (mysql_error());
	}
	
	include "style/template/congratulations.html";
}

include "style/template/footer.html";

?>
 
Änder es so ab:

PHP:
if ($step == '4') {
    $contents = file_get_contents("mysql/install.sql");

    $sqls = explode(';', $contents);

    foreach($sqls as $sql)
    {
      if(trim($sql))
        mysql_query($sql) or die (mysql_error());
    }
    
    $contents2 = file_get_contents("mysql/insert.sql");

    $sqls2 = explode(';', $contents2);

    foreach($sqls2 as $sql2)
    {
      if(trim($sql2))
        mysql_query($sql2) or die (mysql_error());
    }
    
    include "style/template/congratulations.html";
}
 
Zuletzt bearbeitet:
Zurück