getbestproduct
08-25-2010, 11:56 AM
$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.
$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.