Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    166
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. ckh

    ckh Well-Known Member

    Joined:
    Dec 6, 2003
    Messages:
    358
    Likes Received:
    1
    Trophy Points:
    168
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    166
    Ok, I'll try to get more error detail and post again later.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    166
    I'm getting a little lost. Can someone post idiot instructions for exactly what I do where? :eek:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice