Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SUM help

Author  Topic 

ludicrousgib
Starting Member

1 Post

Posted - 2014-07-10 : 04:32:29
Hi.

I'm sorry to ask such a simple question, but being completely clueless, I am struggling with it.

I am trying to echo the sum of a column from a table.



$result = mysql_query("
SELECT SUM(columnname) FROM tablename
");

{
echo $result;
}


I *think* the echo is wrong - but I've copied various methods from various other bits of code I've seen, and I just cannot get it to work.

Apologies again for such a question, and if I posted in the wrong forum. Just pulling my hair out!

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-07-10 : 07:37:53
The code you've posted is not SQL Server code.
Go to Top of Page
   

- Advertisement -