Results 1 to 1 of 1

Thread: PHP/MySQL Help

  1. #1
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default PHP/MySQL Help

    Hello,

    I'm just trying to find out the best way, or even a way of adding up one field for each row in a table in a mysql database.

    What I think should make it work, isn't:

    PHP Code:
    $total "0.00";
    number_format($total,2);
    do {
    $amount $r['amount'];
    $total $total $amount;
    } while (
    $r mysql_fetch_array($result)); 
    It returns $total as 0 (note: not 0.00, just 0).

    How can I make this work?

    Edit: Nevermind, it was my query $result that was the problem. Thread closed.
    Last edited by iUnknown; 23-11-2008 at 01:42 PM.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


Posting Permissions

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