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 4 of 4
  1. #1
    Banned
    Join Date
    Aug 2010
    Location
    everywhere
    Posts
    63
    Thanks
    2
    Thanked 3 Times in 3 Posts

    mysql query Question

    PHP Code:
    $Test = ("SELECT Test, SUM(IF(Test = 'Til', 1,0)) AS `T`, SUM(IF(Test = 'Sil', 1,0)) AS `S` FROM `Show` GROUP BY `Test`");  

    $get mysqli_query($mysqli$Test)or die("Error: ".mysqli_error($mysqli));  

    $gg mysqli_fetch_array($get);  

    echo 
    $gg['T'];  
    echo 
    $gg['S']; 
    When I try something like this, I can get the correct result for the first sum, but after that, it reverts to 0. I was wondering how I could get this to work for both. Thanks again.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Why are you copy pasting someone else's post?

    http://codingforums.com/showthread.php?t=202988

  • #3
    Regular Coder jdswebservice's Avatar
    Join Date
    Aug 2010
    Location
    Moon Township, PA
    Posts
    107
    Thanks
    0
    Thanked 5 Times in 5 Posts
    EPIC FAIL!!!!!!!!!


  • #4
    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
    Quote Originally Posted by Fumigator View Post
    Why are you copy pasting someone else's post?

    http://codingforums.com/showthread.php?t=202988
    Isn't this called as Déjà vu
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Tags for this Thread

    Posting Permissions

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