|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
column sum
Can you kindly help me with this output portion that you posted on
http://www.phpbuilder.com/forum/list.php3?num=5 im fairly new to php and any help would be great |
|
#2
|
|||
|
|||
|
RE: column sum
you could use something like the following:
$db = mysql_connect("localhost","user","pass") or die("Problem connecting"); mysql_select_db("dbname") or die("Problem selecting database"); $query = "SELECT SUM(column) as total FROM table"; $result = mysql_query($query) or die ("Query failed"); $row = $mysql_fetch_array($result); echo $row['total']; Hope that helps.... |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > column sum |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|