Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28

Thread: Database errors with sidebars on custom pages.

  1. #21
    Join Date
    Jan 2005
    Posts
    16

    Default Re: Database errors with sidebars on custom pages.

    Is there a fix for this? I'm having exactly the same problem.

    It's only happening with Members. If a member logs in and clicks the 'remember me?' tickbox, then leaves the site. When that user returns they get this error message:

    Database error in vBulletin 3.5.0:

    Invalid SQL:

    INSERT INTO vb3_session
    (sessionhash, userid, host, idhash, lastactivity, location, styleid, languageid, loggedin, inforum, inthread, incalendar, badlocation, useragent, bypass)
    VALUES
    ('0ad0211f7cc53c8ff5cd80b40488971e', 3, '194.82.37.50', 'a690cadcc94967cb619ab4d084f745ce', 1138210815, '/', 0, 0, 0, 0, 0, 0, 0, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)', 0);

    MySQL Error : Duplicate entry '0ad0211f7cc53c8ff5cd80b40488971e' for key 1
    Error Number : 1062
    Date : Wednesday, January 25th 2006 @ 05:40:15 PM
    Script : http://www.blackburn247.com/
    Referrer :
    IP Address : *******
    Username : *****
    Classname : vb_database
    It's okay for guests, and if you log off before you leave the site.

    Please help! It's really annoying.

    Site is www.blackburn247.com

  2. #22
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Database errors with sidebars on custom pages.

    http://www.vbadvanced.com/membersare...tid=4&pageid=6

    Make sure you're using the exact code from that page. It was updated a few weeks ago to resolve the problem you're describing.

  3. #23
    Join Date
    Jan 2005
    Posts
    16

    Default Re: Database errors with sidebars on custom pages.

    Agh, I implemented that code only last night so I'm pretty sure it's correct. When I'm in a position to verify this I will. I'm at work at the moment so can't ftp in. Will try and verify tomorrow.

  4. #24
    Join Date
    Jan 2005
    Posts
    16

    Default Re: Database errors with sidebars on custom pages.

    I can now confirm that I added that code exactly as described.

    My forums and Vbadvanced are installed in the same folder.

    Any help?

  5. #25
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Database errors with sidebars on custom pages.

    Can you post the code from your functions.php file, starting with this line:
    PHP Code:
    function print_output($vartext$sendheader true
    And then about 20 lines down?

  6. #26
    Join Date
    Jan 2005
    Posts
    16

    Default Re: Database errors with sidebars on custom pages.

    Okay as requested:

    From functions.php (I've added more than 20 lines just in case)...
    function print_output($vartext, $sendheader = true)
    {
    global $pagestarttime, $querytime, $vbulletin;
    global $vbphrase, $stylevar;

    if (defined('NOSHUTDOWNFUNC'))
    {
    exec_shut_down();
    }
    if (defined('VBA_PORTAL') AND !defined('SKIP_OUTPUT') AND !defined('VBA_SCRIPT') AND !defined('NOPMPOPUP'))
    {
    define('SKIP_OUTPUT', true);

    global $home;

    print_portal_output($home, $vartext);
    }
    if ($vbulletin->options['addtemplatename'])
    {
    if ($doctypepos = @strpos($vartext, $stylevar['htmldoctype']))
    {
    $comment = substr($vartext, 0, $doctypepos);
    $vartext = substr($vartext, $doctypepos + strlen($stylevar['htmldoctype']));
    $vartext = $stylevar['htmldoctype'] . "\n" . $comment . $vartext;
    }
    }

    if ($vbulletin->db->explain)
    {
    $pageendtime = microtime();

    $starttime = explode(' ', $pagestarttime);
    $endtime = explode(' ', $pageendtime);

    $totaltime = $endtime[0] - $starttime[0] + $endtime[1] - $starttime[1];

    $vartext .= "<!-- Page generated in " . vb_number_format($totaltime, 5) . " seconds with " . $vbulletin->db->querycount . " queries -->";
    }

    // --------------------------------------------------------------------
    // temporary code
    global $_TEMPLATEQUERIES, $tempusagecache, $DEVDEBUG;
    if ($vbulletin->debug)
    {
    $pageendtime = microtime();
    $starttime = explode(' ', $pagestarttime);
    $endtime = explode(' ', $pageendtime);
    $totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], 5);
    devdebug('php_sapi_name(): ' . SAPI_NAME);
    Many thanks

  7. #27
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Database errors with sidebars on custom pages.

    What version of vBulletin are you running? The code in your functions.php file seems to be slightly different than what I see in my files, and I've seen a couple of other people with the same code. If you'll remove this line though:
    PHP Code:
    if (defined('VBA_PORTAL') AND !defined('SKIP_OUTPUT') AND !defined('VBA_SCRIPT') AND !defined('NOPMPOPUP'))
    {
    define('SKIP_OUTPUT'true);

    global 
    $home;

    print_portal_output($home$vartext);

    And move it to just above this code instead:
    PHP Code:
    if (defined('NOSHUTDOWNFUNC')) 
    Then that should take care of the problem.

  8. #28
    Join Date
    Jan 2005
    Posts
    16

    Default Re: Database errors with sidebars on custom pages.

    That appears to have fixed it. Thankyou very much you've made a handful of people in a small town in the UK a bit happier

    I should have mentioned that I'm using Vbulletin version 3.5.0 with security patches.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. keep getting database errors
    By CnB in forum Troubleshooting & Problems
    Replies: 4
    Last Post: 09-22-2005, 08:15 PM
  2. database errors
    By rinkrat in forum Troubleshooting / "How do I..." Questions
    Replies: 1
    Last Post: 03-28-2005, 11:25 AM
  3. Database errors
    By Mythotical in forum Troubleshooting / "How do I..." Questions
    Replies: 6
    Last Post: 02-07-2005, 04:10 PM
  4. Database Errors
    By javageek in forum Troubleshooting / "How do I..." Questions
    Replies: 8
    Last Post: 01-10-2005, 02:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •