if ($upgrade != 1) { if ($dbms != 'msaccess') { // Load in the sql parser include $phpbb_root_path . 'includes/sql_parse.' . $phpEx; // Ok we have the db info go ahead and read in the relevant schema // and work on building the table.. probably ought to provide some // kind of feedback to the user as we are working here in order // to let them know we are actually doing something. $sql_query = @fread(@fopen($dbms_schema, 'r'), @filesize($dbms_schema)); $sql_query = preg_replace('/phpbb_/', $table_prefix, $sql_query); $sql_query = $remove_remarks($sql_query); $sql_query = split_sql_file($sql_query, $delimiter); for ($i = 0; $i < sizeof($sql_query); $i++) { if (trim($sql_query[$i]) != '') { if (!($result = $db->sql_query($sql_query[$i]))) { $error = $db->sql_error(); page_header($lang['Install'], ''); page_error($lang['Installer_Error'], $lang['Install_db_error'] . '<br />' . $error['message']); page_footer(); exit; } } } // Ok tables have been built, let's fill in the basic information $sql_query = @fread(@fopen($dbms_basic, 'r'), @filesize($dbms_basic)); $sql_query = preg_replace('/phpbb_/', $table_prefix, $sql_query); $sql_query = $remove_remarks($sql_query); $sql_query = split_sql_file($sql_query, $delimiter_basic); for ($i = 0; $i < sizeof($sql_query); $i++) { if (trim($sql_query[$i]) != '') { if (!($result = $db->sql_query($sql_query[$i]))) {
<? include( 'mysql4.php' ); include( '../config.php' ); //first we need to retrieve the list of all active companies that might have imported data $db_support = new sql_db( $supportdb, $dbuser, $dbpasswd, 'nizex_support', false ); if ( $db_support->db_connect_id ) { $query = "select CompanyID, DBName, DBHost, TableVersion from optUserCompany where Active=1 "; if ( !( $result = $db_support->sql_query( $query ) ) ) { $lbl_error = $dblang[ "ErrorInSQL" ]."<br>".$db_support->sql_error(); } while ( $row = $db_support->sql_fetchrow( $result )) { $db = new sql_db( $dbhost, $dbuser, $dbpasswd, $row[ 'DBName' ], true ); $query = "select * from conLeadSources where LeadName='Other'"; if ( !( $result2 = $db->sql_query( $query ) ) ) echo "Problem with: ".$query; if ( $db->sql_numrows( $result2 ) == 0 ) { $query = "insert into conLeadSources values ( null, 'Other', 1 )"; if ( !( $result2 = $db->sql_query( $query ) ) ) echo "Problem with: ".$query; } } //end while looping through companies
echo("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"); echo("<meta name=\"author\" content=\"Icy Phoenix Team\" />\n"); echo("<title>Icy Phoenix :: UTF-8 Conversion</title>\n"); echo("</head>\n"); echo("<body>\n"); echo("<div style=\"font-family: 'Lucida Grande', 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; font-size: 10px;\">\n"); echo("<b style=\"color: #dd2222;\">DB Conversion to UTF-8 in progress, please do not stop the browser until the whole process is finished...</b><br />\n<br />\n<br />\n"); // HTML HEADER - END flush(); $sql = "ALTER DATABASE {$db->sql_escape($dbname)} CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin DEFAULT COLLATE utf8_bin"; $db->sql_query($sql) or die($db->sql_error()); $sql = "SHOW TABLES"; $result = $db->sql_query($sql) or die($db->sql_error()); while ($row = $db->sql_fetchrow($result)) { // This assignment doesn't work... //$table = $row[0]; $current_item = each($row); $table = $current_item['value']; reset($row); if (strpos($table, $table_prefix) === 0) { $sql = "ALTER TABLE {$db->sql_escape($table)}
function getDBHost( $databasename = '' ) { global $supportdb, $dbuser, $dbpasswd; $dbsupport = new sql_db( $supportdb, $dbuser, $dbpasswd, 'nizex_support', false, true ); $query = "select DBHost from optUserCompany where DBName = '".$databasename."'"; if ( !$result = $dbsupport->sql_query( $query ) ) { LogError( 9369, $query ."<br>".$dbsupport->sql_error(), false ); return false; } $row = $dbsupport->sql_fetchrow( $result ); return $row[ "DBHost" ]; }