Location: PHPKode > projects > News manager > install.php
<?php
/* ########################## INFO ##########################

                          News manager
                          Version 1.0

         Free script from WB - Webdesign for beginners.
          Visit http://plohni.com/wb for more scripts.
               Feel free to modify this script.
                              lgp

/* ########################## INFO ########################## */
/* ###################### INSTALLATION ###################### */

   // a) Adjust the configuration variables in config.php to
   //    your needs
   // b) Copy the PHP files to your server using ASCII mode
   // c) Call install.php in your webbrowser

/* ###################### INSTALLATION ###################### */
/* ############# SCRIPT (EDIT AT YOUR OWN RISK) ############# */

  //load configuration
  require("config.php");
  
  //connect to database
  @mysql_connect($db_server,$db_user,$db_password) or die("Database server connection failed. Check variables \$db_server, \$db_user and \$db_password in config.php");
  @mysql_select_db($db_name) or die("Selecting database failed. Check variable \$db_name in config.php");
  
  //create table for image information
  @mysql_query("CREATE TABLE $db_table (id int(10) unsigned NOT NULL auto_increment,date int(10) unsigned NOT NULL default '0',news text NOT NULL,links varchar(255) NOT NULL default '',PRIMARY KEY (id));");
  
  //print result
  if(@mysql_error()){
    ?><p>Could not create table <?php echo $db_table; ?>: <?php echo @mysql_error(); ?></p><?php
  }else{
    ?><p>Table <?php echo $db_table; ?> created successfully. To avoid unexpected trouble please remove this file. <a href="admin.php">Click here to continue.</a></p><?php
  }

  //close database connection
  @mysql_close();
?>
Return current item: News manager