Search Help Board

PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help

C# Help

?take a look at this...
Date:???05-04-04 23:38

we want to display the total hours work of a person from the database. and we used the following codes:

or die("You are not connected");

$sql='select SUM(No_Hours) from timelist where="'.$id.'"';

echo 'Total hours work:'.$result.'';

why is it this statement won't work?
is something missing?
instead of the total hours be dispalayed, this statement will
be displayed: "resource id #5", that supposed to be the value
of $result will be displayed...

do help us...:)

?Re: take a look at this...
Date:???05-05-04 05:30

$result is not the result of the query, its the resource link to the tranasction that produces the output...change your code to:

$sql='select SUM(No_Hours) AS HOURS from timelist where="'.$id.'"';

$while ($rows=mysql_fetch_array($result)){
echo 'Total hours work:'.$rows['HOURS'].'.';

Go to Top??|??Go to Topic??|??Threaded View??|??Search?
New Topic
?Reply To This Message
?Your Name:
?Your Email:
Email replies to this thread, to the address above.

Provided By