Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mysql counting rows

    I want to count the the cows that has a 1 in it the ones with 0 i want to ignore. am I on the right track?

    PHP Code:
    $strQuery333 "SELECT COUNT(*) AS counting "
    ." FROM auto_pings "
    ." WHERE partner_id_buyer = '$ors[partner_id_buyer]_ping_success' "
    ." AND MONTH(date_day)=MONTH(NOW())";
    $result333 mysql_query($strQuery333) or die(mysql_error());
    $ors333 mysql_fetch_array($result333);

    echo  
    "<div class=\"FLeft Ping\">Ping: $ors333[counting]</div>" 

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    It's MySql forum. Please post your table schema with some sample data and the query that you plan to execute (not the PHP code).
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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