<?php
        //DISREGARD COMMENT        
        /*
        $hostname="localhost";
        $dbuser = "";
        $dbpass = "";
        $database = "clientexec_stable";

        $connection = mysql_connect($hostname, $dbuser, $dbpass) or die (_ERRORDBQUERY);
        mysql_select_db($database, $connection) or die("Can not select database: $database");
        */
        
        //Get All Welcome Emails and then update the [CUSTOM_xxx] tag to [CUSTOMPROFILE_xxx]
        $query ="SELECT id,welcomeemail FROM package";
        $result = mysql_query($query) or die("ERROR (Getting Welcome Emails): $query");
        while(list($tID,$welcomeemail) = mysql_fetch_row($result)){
        	  //update old [CUSTOM_ tags to CUSTOMPROFILE tags
        	  $welcomeemail = str_replace("[CUSTOM_","[CUSTOMPROFILE_",$welcomeemail);
              $query2 = "UPDATE package SET welcomeemail='".$welcomeemail."' WHERE id=".$tID;
              $result2 = mysql_query($query2) or die("Update Welcome Email Error: $query2<br>".mysql_error());
        }    
?>
