The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Upgrading mysql broke a user's script

Discussion in 'General Discussion' started by junglecat, Jan 7, 2007.

  1. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    I have a user with a double-opt in mailing list.

    After upgrading mysql to 5.0 this user is unable to send a mailing from his script. This is the error he gets:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/user/public_html/admin/newmail.php on line 431

    I looked at line 431 of that page and see this:

    Code:
    $rows=mysql_num_rows($sql);
    Can I edit that line to make the script work? If so, how do I edit it?
     
  2. ckh

    ckh Well-Known Member

    Joined:
    Dec 6, 2003
    Messages:
    356
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Phoenix, AZ
    cPanel Access Level:
    DataCenter Provider
    That line is basically saying nothing was found in the previous query. The code will probably resemble something like:

    $sql = mysql_query("SELECT * FROM table1", $link);
    $num_rows = mysql_num_rows($sql);

    So the actual query would be "Select * from table1"

    The problem probably isn't the query in itself but maybe a db that needs to be repaired or perhaps the connection to the db isn't being made causing the error.

    You may want to look at the logs or append the query to look like:

    $num_rows = mysql_num_rows($sql) or die(mysql_error());

    It will then show in more detail the mysql error.
     
  3. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Ok, I'll try to get more error detail and post again later.
     
  4. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    I'm getting a little lost. Can someone post idiot instructions for exactly what I do where? :eek:
     
Loading...

Share This Page