Jump to content

ibanez270dx

Members
  • Posts

    53
  • Joined

  • Last visited

    Never

Everything posted by ibanez270dx

  1. Hi, I have a section of a script that needs to check if [month] has been posted, and if it hasn't, assign the default value (date("m")) to $today_month. However, I think this doesn't work because I need some sort of operator in the if( ) thing? [code] if($_POST[month]) { $today_month = "$_POST[month]"; }       else             {               $today_month = date("m");             } [/code] What should I use if I want it to check if there is any value posted for [month] ? Thanks, - Jeff
  2. Hi, I am having problems with a little section of my script (running on MySQL 4). Pretty much, I need to extract all everything in my table (no problem), but then I need to take all the numbers (from column "dwntime_hrs") in each row and add them together. How would I go about doing this? My script looks like this thus far: $sql = "SELECT *, SUM(dwntime_hrs) as total_downtime FROM $table_name WHERE aircraft_id = '$_POST[viewlog]' ORDER BY dwntime_date"; $result = @mysql_query($sql,$connection) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $aircraft_id = stripslashes($row['aircraft_id']); $aircraft_name = stripslashes($row['aircraft_name']); $dwntime_type = stripslashes($row['dwntime_type']); $dwntime_date = stripslashes($row['dwntime_date']); $dwntime_hrs = stripslashes($row['dwntime_hrs']); $dwntime_reason = stripslashes($row['dwntime_reason']); $dwntime_log = stripslashes($row['dwntime_log']); $dwntime_log_by = stripslashes($row['dwntime_log_by']); $total_dwntime_hrs = $row['total_downtime']; However, I get this error: Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause Any ideas? Thanks, - Jeff
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.