General mysql errors

Discussion in 'MySQL' started by Ranger6451, Jun 3, 2010.

  1. #1
    Hey we are trying to set up a ticket system and we are having some issues. We keep getting these warning/errors.

    Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in [path]/arenacp/openapplication.php on line 327

    Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in [path]/arenacp/openapplication.php on line 327

    I don't fully understand what is going on here.

    This is the section of the code where the problem is.

    It goes from Line 312 to 346

    print_textarea_row("", 'comments[comments]', '', 10, 130);
    
    
    print_cells_row(array("", "<input type='hidden' name='comments[appid]' value='$apps[appid]' /><input type='submit' name='comment' value='Comment'></form>"));
    echo'<meta http-equiv="refresh" content="0;url=openapplication.php?do=view&id=$getcuser[appid]"/>';
    	
    	
    	print_table_break('', "900");
    	
    	
    
    print_table_header("<form method='post'>Response");
    
    
    $questions=mysql_query("SELECT responseid,title,userid,DATE_FORMAT(responded,'%m/%d/%Y') FROM appcomments WHERE appid='$apps[appid]' ORDER BY responded DESC");
    while(list($responseid,$title,$userid,$responded)=mysql_fetch_row($questions)){  <<<--- Line 327
    
    $getcuser=mysql_query("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid='$userid'");
    $getcuser=mysql_fetch_array($getcuser);
    
    print_cells_row(array("<a href='../member.php?u=$getcuser[userid]'>$getcuser[username]</a> says:<br />$responded", "$title"));
    
    }
    
    print_textarea_row("", 'Respnce[response]', '', 10, 130);
    
    
    print_cells_row(array("", "<input type='hidden' name='Response[appid]' value='$apps[appid]' /><input type='submit' name='Response' value='Response'></form>"));
    echo'<meta http-equiv="refresh" content="0;url=openapplication.php?do=view&id=$getcuser[appid]"/>';
    
    	print_table_break('', "900");
    	
    	
    
    ?>
    PHP:

    Any help would be greatly appreciated.
     
    Ranger6451, Jun 3, 2010 IP
  2. ashu_sood08

    ashu_sood08 Peon

    Messages:
    125
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you use any type of cursor because the cursor warn like these errors
     
    ashu_sood08, Jun 4, 2010 IP
  3. Ranger6451

    Ranger6451 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Nope no cursor, basically this is when staff want to view their application or if we want to add some comments on it we keep getting these errors. I'm feeling that it can't find the staff application ID number which is why I keep getting the error. I don't know how to go about correcting it.
     
    Ranger6451, Jun 4, 2010 IP
  4. sketchx

    sketchx Member

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    Have you try adding the database to the appcomments table(Ex: DATABASENAME.appcomments ). Is the appcomments in the same database/schema as the other tables?

    I noticed " . TABLE_PREFIX . " in the
    You dont have it in
    And have you try to print the query thru php? and run it directly in an SQL tool?
     
    sketchx, Jun 10, 2010 IP
  5. Ranger6451

    Ranger6451 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    We abandoned the project sadly. But thanks for the support.
     
    Ranger6451, Jun 11, 2010 IP