Announcement

Collapse
No announcement yet.

Database Errors from online.php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Database Errors from online.php

    Suddenly today I started receiving database errors from online.php.

    Invalid SQL:
    SELECT userid, username
    FROM user
    WHERE userid IN (0,5847,5125,4935,935,3627,)


    That's coming from the following code in includes/functions_online.php

    $userresults = $DB_site->query("
    SELECT userid, username
    FROM " . TABLE_PREFIX . "user
    WHERE userid IN (0$userids)
    ");

    I changed that code to add a quick temp fix and just added another 0 after $userids. That worked for a bit, then suddenly that started giving errors as well (obviously because there wasn't a comma at the end of the $userids string, as there shouldn't have been). So I changed the code back to the original code and it worked again, but only for a bit... Then it started giving the same error I posted above. Any idea what could be causing this and how I could fix it?
    Spread Peace,
    Brian Gunter

    vBadvanced | EDMPlanet

  • #2
    Reupload the original functions_online.php file.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Yup, tried that and the original online.php file. Still gives the error.



      Originally posted by Steve Machol
      Reupload the original functions_online.php file.
      Spread Peace,
      Brian Gunter

      vBadvanced | EDMPlanet

      Comment


      • #4
        Hmmm...this started happening after you changed the code but restoring the original files doesn't fix it? Unless you didn't overwrite the hacked files I really don't know what could cause this.
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment


        • #5
          Actually I didn't even change any code receintly. I had hacked the files to add locations for my links.php, music.php, and etc, but that's been about a month ago and I haven't touched the files since.
          I did find a simple fix that seems to be working fine though... I replaced this code:

          $userids .= ",$searchresult[targetuserid]

          With this:

          if (!empty($searchresult[targetuserid]))
          {
          $userids .= ",$searchresult[targetuserid]";
          }

          It's weird too because it only seems to give the error sparatically with the original file. Once I changed that though it's working fine. Just thought I would point it out incase it was some type of a bug...

          Originally posted by Steve Machol
          Hmmm...this started happening after you changed the code but restoring the original files doesn't fix it? Unless you didn't overwrite the hacked files I really don't know what could cause this.
          Spread Peace,
          Brian Gunter

          vBadvanced | EDMPlanet

          Comment


          • #6
            It is a bug that I fixed but did not post. It has something to do with users viewing pms from deleted members if I recall.

            Comment

            Loading...
            Working...
            X