"Fossies" - the Fresh Open Source Software Archive

Member "node-runner-0.6.0/sql/update-nr-to-v0.5.1.php" (22 Dec 2004, 1664 Bytes) of package /linux/www/old/node-runner-0.6.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 <?php
    2 
    3 // This file is used to upgrade the database tables from Node Runner
    4 // v0.5.0 to v0.5.1.  If you need to upgrade from an older version, you
    5 // MUST run each of the older update files first.  It is HIGHLY
    6 // recommended that you just use the install script (select UPGRADE),
    7 // but if you absolutely *need* to update the database manually,
    8 // you can fill in the values below can call the script from the
    9 // php interpreter.  Otherwise, leave them blank.
   10 
   11 $database_host = '';
   12 $database_name = '';
   13 $database_user = '';
   14 $database_pass = '';
   15 
   16 if (!$dbhost) { $dbhost = $database_host; }
   17 if (!$db) { $db = $database_name; }
   18 if (!$dbuser) { $dbhost = $database_user; }
   19 if (!$dbpass) { $dbhost = $database_pass; }
   20 
   21 if ($database_host && $database_name && $database_user && $database_pass) {
   22   unset($err_msg);
   23   $connect = mysql_connect($database_host,$database_user,$database_pass);
   24   if (!$connect) { $err_msg .= mysql_error()."\n"; }
   25 }
   26 
   27 
   28 # DATABASE CHANGELOG:
   29 # 1) Adds auth_user and auth_pass field to objects table
   30 #    for checking responsive status of secure web pages.
   31 
   32 $query1 = "ALTER TABLE objects ADD auth_user varchar(255) NULL";
   33 $result1 = mysql_db_query($db, $query1);
   34 if (!$result1) {
   35     $err_msg .= mysql_error()."\n";
   36 }
   37 
   38 $query2 = "ALTER TABLE objects ADD auth_pass varchar(255) NULL";
   39 $result2 = mysql_db_query($db, $query2);
   40 if (!$result2) {
   41     $err_msg .= mysql_error()."\n";
   42 }
   43 
   44 # Generate some output if this files is run by itself.
   45 if ($database_host && $database_name && $database_user && $database_pass) {
   46   if ($err_msg) {
   47     echo "\nMySQL ERROR:\n\n".$err_msg."\n\n";
   48   } else {
   49     echo "\nDatabase populated successfully.\n\n";
   50   }
   51 }
   52 
   53 ?>