40 users online (1 members and 39 guests)  


  Results 1 to 6 of 6

Related

  1. Help with ASP error    Forum: ASP Forum
    Replies: 0
  2. Replies: 8
  3. Replies: 0
  4. Error MySQL Error: 1064 - subqueries    Forum: PHP Forum
    Replies: 0
  5. please tell me where the error is    Forum: Javascript Forum
    Replies: 3
  1. #1
    deftonez4me's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2006
    Posts
    4

    Question Not your average MySQL_fetch_array error

    Some one please help!! On one of the pages on the web site i am currently writing, I am getting a MySQL_fetch_array Error that is baffling me, over what should be a SIMPLE Update Query.!
    • I've seen the error 100's of times before: "mysql_fetch_array(): supplied argument is not a valid MySQL result resource"
    • When i usually get this, its always something small such as putting a single quote instead of a double . This time, i been looking at this same error for almost 6 hours
    Here's the Code Snippet:
    -------------------------------------------------------------------------
    $new_bid_count = $row['bids'] + 1;
    $new_current_bid = $_POST['place_bid'];

    //update post record
    $query5 = "UPDATE 'needed_posts' SET 'bids'='".$new_bid_count."', 'current_bid'='".$new_current_bid."' WHERE 'post_id'='".$_SESSION['post_id']."'";

    $result5 = @mysql_fetch_array($query5);
    //make sure the query executed successfully
    if(!$result5)
    {
    echo '<p><font color="red" size="+1">Update query unsuccessful!<br>';
    }
    else
    {
    echo '<p><font color="red" size="+1">Thank you for your bid!</font></p>';
    echo "Go back <a href='index.php'>Home</a>";
    include_once('footer.html');
    exit();
    }
    ---------------------------------------------------------------------------------
    Here's a screenshot of the entire error code:





    -------------------------------------------------------------------------------------
    Here's a screenshot taken before error takes place:


    -------------------------------------------------------------------------------------
    If anybody can help me i would be most grateful!! If you need anymore info about the page/site in order to help you figure this out just let me know.

    Thanks in advance!!!

  2. #2
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Not your average MySQL_fetch_array error

    Find this code in your script:

    Code:
    $query5 = "UPDATE 'needed_posts' SET 'bids'='".$new_bid_count."', 'current_bid'='".$new_current_bid."' WHERE 'post_id'='".$_SESSION['post_id']."'";
    Immediately after that code, add the following statement:

    Code:
    die($query5);
    That will show you the actual query that you're running. Does it look correct? If so, copy and paste it into phpMyAdmin and run it from there. What kind of error message do you get?

    If none of this makes sense to you, just post the results from that die() statement so we can have a look at the actual query you're trying to run.

    BTW, it would be helpful if you'd use code tags, as I have done.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  3. #3
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Not your average MySQL_fetch_array error

    Are we not already dealing with this error here?
    I'm not sure the error's in the code you're displaying - we need at least the first 15-20 lines of C:\easyphp1-8\www\config.inc so that we can literally count down and establish exactly where the error is!
    Last edited by DeadMeatGF; 07-04-2006 at 02:54 AM.

  4. #4
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Not your average MySQL_fetch_array error

    Quote Originally Posted by DeadMeatGF
    Are we not already dealing with this error here?
    So shoot me for not realizing that this was double posted and already answered. I don't read the whole forum prior to posting.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  5. #5
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Not your average MySQL_fetch_array error

    Quote Originally Posted by vinyl-junkie
    So shoot me for not realizing that this was double posted and already answered. I don't read the whole forum prior to posting.
    LL
    That was more aimed at deftonez - I didn't realise both threads were posted at the same time!

  6. #6
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Not your average MySQL_fetch_array error

    No problem. I kind of kicked myself anyway for replying because I saw that other thread almost immediately after replying to this one.

    Off-Topic: BTW, I meant to congratulate you on becoming an AHFB All-Star. It is well deserved!
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more



Tags for this Thread