mysql_num_rows(): supplied argument is not a valid MySQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matheussousuke
    New Member
    • Sep 2009
    • 249

    #1

    mysql_num_rows(): supplied argument is not a valid MySQL

    I'm having the following trouble:

    Warning: mysql_num_rows( ): supplied argument is not a valid MySQL result resource in /home/mghosped/public_html/anuncieaki/lib/func_common.php on line 149


    This is the line 149

    Code:
    for ($i=1; $i<mysql_num_rows($result); $i++  )

    The same script works fine in another server, but not in that one.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    check if mysql_query() return false.

    Comment

    • matheussousuke
      New Member
      • Sep 2009
      • 249

      #3
      Originally posted by Dormilich
      check if mysql_query() return false.
      Where do I check that?

      Ps: I've no access to php.ini.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        Originally posted by matheussousuke
        Where do I check that?
        Code:
        $result = mysql_query($sql) or die("Oops, I did it again: " . mysql_error());

        Comment

        • matheussousuke
          New Member
          • Sep 2009
          • 249

          #5
          Originally posted by Dormilich
          Code:
          $result = mysql_query($sql) or die("Oops, I did it again: " . mysql_error());


          I guess I got it, I've do following on the lines 234 and 136:

          Code:
           $result = mysql_query($query, $myDB);

          Is this that I need to change?

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            yepp
            _______________ ____

            Comment

            • matheussousuke
              New Member
              • Sep 2009
              • 249

              #7
              Originally posted by matheussousuke
              I guess I got it, I've do following on the lines 234 and 136:

              Code:
               $result = mysql_query($query, $myDB);

              So it will be like this?

              Code:
              $result = mysql_query($query, $myDB);or die("Oops, I did it again: " . mysql_error());

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                without the first semicolon.

                Comment

                • matheussousuke
                  New Member
                  • Sep 2009
                  • 249

                  #9
                  Originally posted by Dormilich
                  without the first semicolon.

                  Now I got the following error:

                  Oops, I did it again: Table 'mghosped_akidb .std_categories ' doesn't exist

                  Comment

                  • Dormilich
                    Recognized Expert Expert
                    • Aug 2008
                    • 8694

                    #10
                    if this table does not exist, you cannot query it…

                    Comment

                    • matheussousuke
                      New Member
                      • Sep 2009
                      • 249

                      #11
                      Originally posted by matheussousuke
                      Now I got the following error:

                      Oops, I did it again: Table 'mghosped_akidb .std_categories ' doesn't exist
                      Oops, I did a terrible mistake, wait a minute.

                      Comment

                      • matheussousuke
                        New Member
                        • Sep 2009
                        • 249

                        #12
                        Ok, I did it. Thanks.

                        Comment

                        Working...