View Single Post
  #2  
Old 27th Jan 04, 08:11 PM
JacKDynne's Avatar
JacKDynne JacKDynne is offline
Administrator
 
Join Date: Oct 2001
Location: The Past Through Tomorrow
Posts: 1,591
JacKDynne will become famous soon enoughJacKDynne will become famous soon enough
Send a message via MSN to JacKDynne
Resolved

This is how:

Code:
<? // get current user sum of straight time $query = "SELECT SUM(hours) from log WHERE tid = '1' AND date >= '$sdate' AND date <= '$edate' AND uid = '$_SESSION[SESSION_UID]'"; $result = mysql_db_query($database, $query, $connection) or die ("Error in query: $query . " . mysql_error()); $reghrs = mysql_result($result, 0); // correction if sum is zero - explicitly assign it 0, so that it gets printed in report if (!$reghrs) { $reghrs = 0; } ?>
and this to print it:

Code:
<tr> <td valign=top align=left><font color=#000000>Regular Hours</font> &nbsp; <td valign=top align=center><font color=#000000><b><? echo sprintf("%1.01f", $reghrs); ?></b></td> </tr>
Props out to Sephiroth

/JD
__________________


Reply With Quote