homepage Welcome to WebmasterWorld Guest from 174.129.76.87
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / WebmasterWorld / Community Building and User Generated Content
Forum Library, Charter, Moderators: rogerd

Community Building and User Generated Content Forum

    
phpBB sessions error
critical error even with patch installed
buksida

10+ Year Member



 
Msg#: 431 posted 8:18 am on Apr 26, 2005 (gmt 0)

phpBB : Critical Error

Could not connect to the database

Thats what I'm getting. Now a while back I read about the sessions database overflowing or something and you need to stick a lump of code into sessions.php to automatically clear it like so:

$error = TRUE;
if (SQL_LAYER == "mysql" ¦¦ SQL_LAYER == "mysql4")
{
$sql_error = $db->sql_error($result);
if ($sql_error["code"] == 1114)
{
$result = $db->sql_query('SHOW TABLE STATUS LIKE "'.SESSIONS_TABLE.'"');
$row = $db->sql_fetchrow($result);
if ($row["Type"] == "HEAP")
{
if ($row["Rows"] > 2500)
{
$delete_order = (SQL_LAYER=="mysql4")? " ORDER BY session_time ASC" : "";
$db->sql_query("DELETE QUICK FROM ".SESSIONS_TABLE."$delete_order LIMIT 50");
}
else
{
$db->sql_query("ALTER TABLE ".SESSIONS_TABLE." MAX_ROWS=".($row["Rows"]+50));
}
if ($db->sql_query($sql))
{
$error = FALSE;
}
}
}
}
if ($error)
{
message_die(CRITICAL_ERROR, "Error creating new session", "", __LINE__, __FILE__, $sql);
}

This doesnt seem to have solved the problem ... anything else I need to or is there a new patch since version 2.0.12?
Thanks

 

jasonlambert

10+ Year Member



 
Msg#: 431 posted 10:32 am on Apr 26, 2005 (gmt 0)

could not connect to database generally means:

- your database server is not running
- your database username/password/hostname in config.php are incorrect

J.

buksida

10+ Year Member



 
Msg#: 431 posted 6:50 am on Apr 27, 2005 (gmt 0)

It was the server, one of the other sites on our server was chewing bandwidth and makeing our site run as slow as a lame dog, this was causing the DB connection errors.

Cheers anyway.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Community Building and User Generated Content
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved