SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Addict
    Join Date
    Jun 2002
    Location
    ***
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    script was okay.......now all kinds of error msgs

    Hello

    I have two websites that run by php scripts. One is a recipe site and one is a picture rating site. Both use different scripts from two different developpers but both scripts are php.

    The sites have been fine and running since about March. They were okay about 2 weeks ago BUT sometime since then something has happened.

    There are all kinds of error msgs on both sites as though the scripts have not been installed properly. I have not touched anything.


    **** (example of error;
    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in fst/var/www/html/common.php on line 37) ****



    What could have caused this? Could the server cause this?

    How do I stop this from happening again and how do you know it is going to happen. I am plexplexed and a little peeved since I didn't realize this was happening.

    Any suggestions would be helpful. Thx

  2. #2
    Now with customized title Jump's Avatar
    Join Date
    Sep 2002
    Location
    The Restaurant at The End of The Universe
    Posts
    1,423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to post common.php, specifically the part that has to do with line 37 so that peeps can help ya.

  3. #3
    SitePoint Addict whofarted's Avatar
    Join Date
    Aug 2001
    Location
    lost, If you find me please return me to St.Louis
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got no idea what's on line 37 in your common.php file but my first guess is this, Has your host recently updated anything?

    Have they maybe turned off register_globals?
    Talk to your host. See if they've upgraded/changed anything recently.
    You smell something?

  4. #4
    SitePoint Addict
    Join Date
    Jun 2002
    Location
    ***
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes they just upgraded the ensim panel and they has been problem after problem. So many of the features are not working properly but I didn't know if that would affect a script.???????

    I'll post some code.....I wasn't sure if it was relevant here.....

  5. #5
    Now with customized title Jump's Avatar
    Join Date
    Sep 2002
    Location
    The Restaurant at The End of The Universe
    Posts
    1,423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd be willing to bet It's a register globals issue.

  6. #6
    SitePoint Addict
    Join Date
    Jun 2002
    Location
    ***
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have attached the common file you requested.

    Host says script installs is not part of support. I said I am aware of that but something has happened to cause this. They worked fine for over 6 months.

  7. #7
    SitePoint Addict whofarted's Avatar
    Join Date
    Aug 2001
    Location
    lost, If you find me please return me to St.Louis
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no need to attach the file just copy & paste it in [ php] BB code like this

    PHP Code:
    if($this_is_php_code)
    {
        echo
    "YAY!";
    }
    else
    {
        echo
    "Boooooo";

    You smell something?

  8. #8
    SitePoint Addict
    Join Date
    Jun 2002
    Location
    ***
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wish I knew how to put the nice white box around it like you guys do.

    PHP Code:
    <?php
    function nextid($tablename$idname) {
       global 
    $db;
       
    $nextid 1;
       
    $sql "SELECT $idname FROM $tablename order by $idname desc";
       
    $result mysql_query($sql ,$db);
       if (
    $myrow mysql_fetch_array($result)) {
          
    $nextid $myrow[$idname];
       }
       
    $nextid = ($nextid 1);
       return 
    $nextid;
    }
    function  
    dbdate() {
     
    $dbdate date("Y-m-d");
     return 
    $dbdate;
    }
    function 
    ad($groupid) {
       global 
    $db;
       
    $sql "select adid from ads where groupid = $groupid";
       
    $result mysql_query($sql ,$db);
       
    $numrows mysql_num_rows($result);
       
    $adcount 1;
       if (
    $numrows 0) {
          if (
    $myrow mysql_fetch_array($result)) {
             do {
                
    $adids[$adcount] = $myrow["adid"];
                
    $adcount++;
          } while (
    $myrow mysql_fetch_array($result));
          }
          
    $adid $adids[rand(1$adcount-1)];
          
    $adhtml "$adid";
          
    $sql "select * from ads where adid = $adid";
          
    $result mysql_query($sql ,$db);
       if (
    $myrow mysql_fetch_array($result)) {
        do {
                 if (
    $myrow["type"] == 'A') {
                    
    $adhtml $myrow["code"];
                 }
                 if (
    $myrow["type"] == 'O') {
                    
    $url $myrow["url"];
                    
    $imagetype $myrow["image"];
                    
    $adhtml "<a href=""bannerclick.php?adid=$adid><img src=""ads/$adid.$imagetype border=0></a>\n";
                 }
                 
    $imps $myrow["impressions"] + 1;
        } while (
    $myrow mysql_fetch_array($result));
          }
          
    $sql "update ads set impressions = $imps where adid = $adid";
          
    $result mysql_query($sql ,$db);
       } else {
          
    $adhtml "&nbsp;";
       }
       return 
    $adhtml;
    }
    function 
    logincheck($uid$upwd) {
        global 
    $db;
        if ((
    $uid == "") || ($upwd == "")) {
           
    $accountok false;
        } else {
           
    $sql "select * from users where userid = $uid and password = '$upwd'";
           
    $result mysql_query($sql ,$db);
           
    $numrows mysql_num_rows($result);
           if (
    $numrows 0) {
              
    $accountok true;
           } else {
              
    $accountok false;
           }
        }
        return 
    $accountok;
    }
    ?>
    Last edited by naramation; Sep 6, 2003 at 19:42.

  9. #9
    SitePoint Addict
    Join Date
    Jun 2002
    Location
    ***
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    line 37 =

    $result = mysql_query($sql ,$db);

  10. #10
    o_O O_o BlueFire2k5's Avatar
    Join Date
    Mar 2003
    Location
    Sioux Falls, SD
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code for adding php syntax highlighting is [ php ] [ /php ] removing the spaces.

  11. #11
    SitePoint Addict
    Join Date
    Jun 2002
    Location
    ***
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks bluefire for giving me that code.

    Update on problem:

    it seems the passwords for the SQL databases have changed for both sites. When I changed the passwords back to the originals, that problem was eliminated.

    I am really confused becuse I have absolutely NOT touched these two sites.

    But thanks for trying to help me.


Bookmarks

Posting Permissions

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