Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Database Error

Aloittaja blodder24, helmikuu 27, 2009, 08:02:37 IP

« edellinen - seuraava »

blodder24

I included SSI.php in my websites main page and it has the error:

Database Error:
File: Site\SB\forum\Sources\Load.php
Line: 2013

Line 2013 is the first: LIMIT 1", __FILE__, __LINE__);

function sessionWrite($session_id, $data)
{
global $db_prefix;

if (preg_match('~^[A-Za-z0-9]{16,32}$~', $session_id) == 0)
return false;

// First try to update an existing row...
$result = db_query("
UPDATE {$db_prefix}sessions
SET data = '" . addslashes($data) . "', last_update = " . time() . "
WHERE session_id = '" . addslashes($session_id) . "'
LIMIT 1", __FILE__, __LINE__);

// If that didn't work, try inserting a new one.
if (db_affected_rows() == 0)
$result = db_query("
INSERT IGNORE INTO {$db_prefix}sessions
(session_id, data, last_update)
VALUES ('" . addslashes($session_id) . "', '" . addslashes($data) . "', " . time() . ")", __FILE__, __LINE__);

return $result;
}


Any ideas?

blodder24

According to another post: http://www.simplemachines.org/community/index.php?topic=261306.0

LainaaBasically the timeouts are set too low meaning that mysql is dropping the connection part way through loading the page.
And when smf tries to query the database again its getting the message Mysql has gone away.

I include SSI.php at the beginning of my page to tell whether or not a user is logged in. At this point SMF connects to the dB. Afterwards my main website connects to the dB. Is there something I can do to stop SMF from querying the dB, hide this error, or have SMF and my main website connect to the dB once?

Thanks!

karlbenson

SMF has to query the db to find out who is logged in.

blodder24

The query is successful, because it shows that the user it logged in. Is there a way that I can hide the error?

Rumbaar

What is the exact code you are using to call SSI.php and use it?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: