Hi All,
So here is my question. I am working on a work order tracking system for our maintenance department. My MySQL table is fairly simple.
I'm not going to write down all the departments because, well, it doesn't serve a purpose, you get the idea.
id, wodate, monthnum, admin, cogen, maint, warehouse
Here is the code which I am using to do the basics. Afterwards, my dilema.
//I am just going to use * instead of the field names since I don't want to type it out.
$sql = ("SELECT * from wotracking ORDER BY wodate ASC");
echo '<table><tr><td>Admin</td><td>Cogen</td><td>Maint</td><td>Total</td></tr>';
echo '<tr>';
while ($row = mysql_fetch_array ($sql)) {
$weeklytotal = ($row['admin'] + $row['cogen'] + $row['maint']);
echo '<td>'.$row['admin'].'</td><td>'.$row['cogen'].'</td>'.'<td>'.$row['maint'].'</td><td>'.$weeklytotal.'</td>';
}
echo '</tr><tr><td colspan="2"> </td><td>'.$monthlytotal.'</td></tr></table>';
So yeah, I need to get the total of every row that is being displayed and store that number in a variable to be displayed at the bottom of the table.
I posted in phpfreaks and started to get help but the replies suddenly stopped. I was told I should typecast my variables but I do not have any experience in doing this.
Any suggestions would help alot. Please give examples though because I'm a bit dim right now & still need some learnin'.