URGENT URGENT Error Config File

Wondering why that MOD you have won't install correctly? Let's take a look
Forum rules
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
Locked
THDAdmin
Registered User
Posts: 5
Joined: Sun Nov 25, 2007 9:39 am

URGENT URGENT Error Config File

Post by THDAdmin »

I installed a Mod called Optimize Database with easymod and then it required me to manually run the sql query, i ran it and it went successful, then i go to my Forum and on every page i click an Error Repot comes up

Image

Heres my [optimize_database_cron.php]:

Code: Select all

/***************************************************************************
 *                            optimize_database_cron.php
 *                            -------------------
 *   begin                : Tuesday , Sep 23, 2003
 *   copyright            : (C) 2003 Sko22
 *   email                : sko22@quellicheilpc.com
 *
 *   $Id: optimize_database_cron.php,v 1.0.2 2003/10/06 09:27:30
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

//
// Optimize database config
//
$sql = "SELECT * FROM " .  phpbb_optimize_db . " ";

$opt_result = $db->sql_query($sql);

if( !( $opt_row = $db->sql_fetchrow($opt_result) ) )
{
   message_die(GENERAL_ERROR, 'Could not obtain optimize database config', '', __LINE__, __FILE__, $sql);
}

if ( ( $opt_row['cron_enable'] == '1' ) && ( $opt_row['cron_lock'] == '1' ) )

{
   
   //
   // Lock cron for contemporary accesses
   //
   $sql = "UPDATE " . OPTIMIZE_DB_TABLE . " SET cron_lock = '0' ";

   if( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not lock optimize database cron', '', __LINE__, __FILE__, $sql);
   }

   $current_time = time();
   
   //
   // Check cron next
   //
   if ( $opt_row['cron_next'] <= $current_time )
   {
   ignore_user_abort();

   //
   // Get tables list
   //
   $list = mysql_list_tables($dbname);

   //
   // Optimize tables
   //
   while ( $tab = $db->sql_fetchrow($list) ) {
      
      foreach ($tab as $column_value) {
         $sql = "OPTIMIZE TABLE $column_value";
         if ( !$result = $db->sql_query($sql) )
            {
            message_die(GENERAL_ERROR, "Couldn't optimize database", "", __LINE__, __FILE__, $sql);
            }
        }
   
   }

   $sql = "UPDATE " . OPTIMIZE_DB_TABLE . " SET cron_next = " . ( $current_time + $opt_row['cron_every'] ) . ", cron_count = cron_count+1 ";

   if( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not update next optimize time', '', __LINE__, __FILE__, $sql);
   }
   }

}

else

{

//
// Unlock cron for contemporary accesses
//
$sql = "UPDATE " . OPTIMIZE_DB_TABLE . " SET cron_lock = '1' ";
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not unlock optimize database cron', '', __LINE__, __FILE__, $sql);
}

}

?>
Please Please Please Help

User avatar
WhiteWolfSix
Registered User
Posts: 210
Joined: Fri Jan 21, 2005 9:05 am
Location: 48°43′N, 19°08′E

Re: URGENT URGENT Error Config File

Post by WhiteWolfSix »

Please, check whether your table prefix is phpbb or not. If not, then do this:

Find:

Code: Select all

$sql = "SELECT * FROM " .  phpbb_optimize_db . " ";
Replace:

Code: Select all

$sql = "SELECT * FROM " .  {yourprefix}_optimize_db . " ";
{yourprefix} = replace with your real table prefix
Image
WhiteWolfSix (WW6)

THDAdmin
Registered User
Posts: 5
Joined: Sun Nov 25, 2007 9:39 am

Re: URGENT URGENT Error Config File

Post by THDAdmin »

I always whenever installing a PhpBB always leave the prefix as default, just to make sure though i tried others but it didnt work. Any more suggestions.

Locked