I've found this script online that I'm trying to modify for my needs...still newbie at it though.
Basically it's supposed to take two values from the db table (AdmitDate and DischDate) and calculate the difference in days. If the dates are the same, make the value 1 day.
The error I'm getting is
Parse error: syntax error, unexpected T_ELSE in filename.php on line 13
<?php // calculate difference and convert to days the absolute value; 1 day = 86400 s $diff = abs($AdmitDate-$DischDate); $diff = $diff/86400; // remove decimals If ($AdmitDate == $dischDate); $diff = ceil($diff) + 1; else $diff = ceil($diff); // Update records for LOS column in the database $sql = "update PatientInfo set LOS=$diff"; // execute the select query $open = execute_db($sql, $conn); ?>