Results 1 to 7 of 7
  1. #1
    Join Date
    May 2004
    Location
    Milton, Florida
    Posts
    783

    MySql Error... $Result_set

    Im getting this error:

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/profoun/public_html/helpdesk/includes/functions.php on line 577

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/profoun/public_html/helpdesk/includes/functions.php on line 577

    But Im not quite sure whats causing this to happen all of a sudden..
    Line 572 thru 596
    PHP Code:
        function fetch_row($result_set$dorowset false ) { 

            
    /* Kinder edits    */ 
            
    if( !$dorowset ) {         

                return 
    mysql_fetch_array($result_set); 
            } 
            if( 
    $dorowset ) { 
                
    /* Load into $this->rowset as an array */ 
                
    while( $this->rowset$result_set ] = mysql_fetch_array$result_set ) ) 

                { 

                    
    $result[] = $this->rowset$result_set ]; 

                } 



                return 
    $result
            } 

                                     

        } 
    Everything worked flawlessly then it gives me this error.. i have tried re-uploading the original files without my edits but that hasnt worked / helped..

    Most of my functions use $result_set as a parameter / arguement..

    I can upload the full Functions.php if needed ( However, it is about 2500 lines ..)

    Functions.php is the only page to have $result_set in it..

    http://profound-hosting.com/helpdesk/viewaccount.php
    *Im aware that the buttons on the banner do not work...*

    Thanks For your Help in Advance!!

  2. #2
    Join Date
    Jul 2002
    Location
    Israel
    Posts
    351
    PHP Code:
    function fetch_row($rs=NULL$drs=false)
    {
        if (!
    mysql_num_rows($rs))
            return array();
        if (!
    $drs)
            return 
    mysql_fetch_array($rs);
        
    $r = array();
        while(
    false !== ($x mysql_fetch_array($rs)))
            
    $r[] = $x;
        return 
    $r;

    C#/C++/TCL/Python/PHP developer.
    mark at mark org il

  3. #3
    Join Date
    Mar 2004
    Location
    USA
    Posts
    4,342
    just do this: @mysql_fetch_array instead of mysql_fetch_array

    the error just says, that the array you sent is empty, adding the @ beforehand will just ignore that error..

    Peace,
    Testing 1.. Testing 1..2.. Testing 1..2..3...

  4. #4
    Join Date
    May 2004
    Location
    Milton, Florida
    Posts
    783
    Kick ***... you guys rock

    It works now... Thanks for the Help

  5. #5
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    the error just says, that the array you sent is empty, adding the @ beforehand will just ignore that error..
    This is not what the error states. The errror is saying that you did not provide a vaid MySQL result set to mysql_fetch_array.

    In other words, $result_set is not a MySQL resource, which means that either your query from where you get $result_set is in error, or there is a problem with your MySQL connection/queries.

    I would suggest you use mysql_error. It really baffles me how many people assume that MySQL queries will work correct the first time, and every time after that.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  6. #6
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    1,082

  7. #7
    Join Date
    May 2004
    Location
    Milton, Florida
    Posts
    783
    thanks guys.. im going to set up a if statement to handle the errors...
    Thanks for all your help!!

Posting Permissions

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