Database Error: Table 'db_joomla.smf_sessions' doesn't exist

Started by rdx, January 12, 2007, 09:04:31 AM

Previous topic - Next topic

rdx

README says:

Database Error: Table 'db_joomla.smf_sessions' doesn't exist
File: /home/user/public_html/joomla/forum/Sources/Load.php
Line: 1886
Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0

If that happens, please add this to the bottom of your Joomla template:
<?php mysql_select_db($GLOBALS['db_name']); ?>

Now, I'm baffled by this. The bottom of my Joomla Template?  Can someone spell out what that explicitly means, please? What file/dir or whatever are we talking about? Thanks.

Kindred

in your joomla/templates/templatename/index.php file

(i.e. the joomla template)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Orstio

Alternatively, you can go to your Joomla admin panel, Site menu -> Template Manager -> Site Templates.

Click on the name of the template(s) with green arrows next to them in order to edit them, and then add the code above in the appropriate location in the textarea.

undoIT

I've added this code to the bottom of my joomla template:

<?php mysql_select_db($GLOBALS['db_name']); ?>

For some reason the following error is still showing up, but only on the homepage:

Database Error: Table 'myaccount_db.smf_sessions' doesn't exist
File: /home/myaccount/public_html/smf/Sources/Load.php
Line: 2005


Is there anything else that might be causing this error?

Orstio

Does your Joomla database user have access to your SMF database?

undoIT

by the way are there any advantages or disadvantages to having both joomla and smf installed in a single database other than for organizational purposes?

Orstio

If you have a fairly small site, one database would be preferable.  That way, you only have one database backup to deal with, and on a small site, the backup file will be relatively small as well.

On a larger site with lots of activity, however, two databases would be preferable.  Not only does it keep things more organized, but it will keep your backups separate.  On large sites, the database backup files can be huge, and having SMF and Joomla in the same database can make it unmanageable.

undoIT

Yeah.  That's why I decided to go with two databases.  I wasn't sure if there would be any performance advantages either way.

Another strange thing is that this bit of code is showing up in the left sidebar for my site, even when I have the SMF login unpublished and on pages that do not have any SMF content:

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_formSubmitted;
function submitonce(theform)
{
smf_formSubmitted = true;
}

function send_form(form_id)
{
document.getElementById(form_id).submit();
}

function submitThisOnce(item)
{
// Hateful, hateful fix for Safari 1.3 beta.
if (navigator.userAgent.indexOf('AppleWebKit') != -1)
return !smf_formSubmitted;

for (var i = 0; i < item.form.length; i++)
if (typeof(item.form[i]) != "undefined" && item.form[i].tagName.toLowerCase() == "textarea")
item.form[i].readOnly = true;

return !smf_formSubmitted;
}
// ]]></script>


For some reason it seems to be causing some display errors for the left sidebar in IE7 only in the Gallery section, but only when a user is logged in.  There are no display errors in Firefox or Opera.  So many little bugs :P


undoIT

http://themebot.com/gallery/

the center column overlaps the left column a bit in IE7 when a user is logged in.  there is no overlap otherwise.

Orstio

I'm using IE7, and I don't see anything wrong at all.

I haven't logged in yet, but I do suspect it may have something to do with the discussbot.

undoIT

I don't have discussbot published.  You should see what i'm talking about if you log in.  That is the only time it is visible.

Orstio


undoIT

Then center column doesn't overlap the border on the left modules in http://themebot.com/gallery/

?

I just tried it on another computer with IE6 and I see this.

Also, that bit of javascript code I posted earlier is from the discussbot.  Come to think of it, i'm pretty sure i started seeing problems after installing that.  But i'm not sure if the database error was there or not.  I just might not have checked it on the homepage.

Anyways, the discussbot was deleted and then completely removed via FTP.  That's no good that it left remnants of code floating around.  I need to find where that is located and delete it.

undoIT

The issues I was having with this are solved.  Something went haywire with an installed module.  I reverted to a backup from a couple days ago and everything is working properly now.  No more database error, although the strange display error in Internet Explorer for the Gallery section still remains.  I think it may be related to this hack which was needed to get the Gallery bridge working:

http://www.simplemachines.org/community/index.php?topic=83665.msg577929#msg577929

mpetrie

I get the same error if I install the smf.discussbot. I've just tried 4.2b1 with Joomla 1.0.12, smf 1.1.2, bridge just upgraded to 1.1.7. If I unpublish the bot it doesn't help - I have to uninstall it.

I added the code to the bottom of the site template - both above & below the closing body tag but it doesn't make any difference.

Orstio

Copy the EXACT erro you get and paste it here.  I'll bet the "smf_" part is missing.

mpetrie

Hi Oristo,

You're right! The error is (path changed):

Database Error: Table 'site_joomla.sessions' doesn't exist
File: /home/site/public_html/forums/Sources/Load.php
Line: 2022


This is without the bot even being published - which has no effect on the error. It also doesn't make any difference whether or not the code block (below) is in the Joomla template or not.

The enf of my Joomla template (sample_longgray) is:

</body>
<!-- SMF Bridge -->
   <?php mysql_select_db($GLOBALS['db_name']); ?>
<!-- SMF Bridge -->
<!-- SMF Discuss Bot -->
   <?php
     ob_start
('output');
     
$buffer = ob_get_contents();
     
ob_end_clean();
     
$buffer = str_replace('<input type="hidden" name="sc" value="" />'
       
,'<input type=hidden name="sc" value="'.$sc.'">', $buffer);
     echo
$buffer;
 
?>
<!-- SMF Discuss Bot -->
</html>


The only way to remove the error is to uninstall the bot.

I don;t know if this is relevent: the Joomla database prefix is the default jos_, but the smf prefix is forums_, and not the default smf_.

Mike

Orstio

Install the bot.

Go to the Mambots menu in your Joomla admin panel.  Click on Site Mambots.

Find the smf.discussbot in the list of bots.  It might not be on the first page.  When you find it, click on it.

Look on the right hand side of the page for the parameters.  In those parameters, you will see two fields for inputting the SMF database name and database prefix.  You will need to enter values into those fields.

mpetrie

Ah! That's fixed it!

Can I suggest adding this to the readme - I completely missed it, assuming that it would be picked up from the SMF or bridge, which is probably asking too much because you aren't going to know where they are.

It also gave me the tip to find the missing comment icon - my joomla lives in a sub-directory of the site root, so I needed to add that to the start of the path.

While on the subject of settings (should I open new topics for these questions?) - how do you point the discussion to child boards - I have two boards called Discussion, one General, and the other Technical. How do I select a specific one. Can I also point to an existing board and topic? Can the number of words to be quoted be set to "up to", so a short article doesn't get a 700 letter quote but just the number of letters it contains?

Thanks for your quick replies and constant help.

Mike

Advertisement: