Simple Problem!

Discussion in 'PHP' started by Darkhodge, Feb 25, 2007.

  1. #1
    Heya,



    I seem to be having problems with the following section of my script. When I run the sql in PHPMyAdmin it finds the row correctly so that part of the code must be right.

    However the line with mysql_result doesn't work as I get the following error:

    This is my code for this part. 261 is the line that sets $cashReq.

    If you could spot the mistake that'd be great :)

    
    // Make sure payment_gross is correct
    $sql     = "SELECT price FROM payments WHERE id = $invoice LIMIT 0,1";
    $result  = mysql_query  ($sql , $conn);
    
    if ($result){
      $cashReq = mysql_result ($result, 0);
    }
    
    PHP:

    Thanks,

    Hodge
     
    Darkhodge, Feb 25, 2007 IP
  2. keiths

    keiths Peon

    Messages:
    109
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    echo $sql and see what it says

    What is $invoice? Is $conn set to something?
     
    keiths, Feb 25, 2007 IP
  3. Darkhodge

    Darkhodge Well-Known Member

    Messages:
    2,111
    Likes Received:
    76
    Best Answers:
    1
    Trophy Points:
    185
    #3
    Sorry I fell asleep and forgot to update this thread but I noticed that it was due to the fact that I hadn't uploaded the updated version of the config.php file...

    So stupid :eek:
     
    Darkhodge, Feb 25, 2007 IP