techker Posted September 21, 2008 Share Posted September 21, 2008 hey guy i have this script that inputs in a db how many times you done this week.. so i made a page that views the hours and i would like to but an if in every query that if there is nothing in the db output OFF this is my query $query3 = "SELECT COUNT(*) AS TotalCount, `to_t2` - `from_t2` AS TotalNumber, SUM( `to_t2` - `from_t2`) AS Totalhours FROM `week2`GROUP BY `from_t2` "; $result3 = mysql_query($query3) or die(mysql_error()); can i add an order by even if there is a group by? Quote Link to comment https://forums.phpfreaks.com/topic/125220-solved-if-questions/ Share on other sites More sharing options...
fenway Posted September 29, 2008 Share Posted September 29, 2008 can i add an order by even if there is a group by? Sure... did it not work? Quote Link to comment https://forums.phpfreaks.com/topic/125220-solved-if-questions/#findComment-653293 Share on other sites More sharing options...
techker Posted September 29, 2008 Author Share Posted September 29, 2008 ya its good thx Quote Link to comment https://forums.phpfreaks.com/topic/125220-solved-if-questions/#findComment-653328 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.