So, I'm trying to build an invoice system for my customers.
I want to add up the number of hours I worked per day, which are stored in a column in my table "hourlog".
The following code outputs the word "Array" where it should be the #.... I've read the manual, and every related and some-what-related tutorial and forum posts, and now I have a headache 😉
<?php
$total_hours = mysql_query ("
SELECT SUM(hours)
FROM hourlog
WHERE paid LIKE 'n'
");
if (mysql_num_rows($total_hours)>0)
{
$total = mysql_fetch_row($total_hours);
print "<tr><td colspan=4><p align=right>";
print $total;
print " total hours worked</td></tr>";
}
else
{
print "<tr><td>";
print " sorry dude, still didn't work!</td></tr>";
}
?>
Should I be taking a whole other approach????
Thank you in advance,
-A