I don't think your code should work anyway, you should really check PHP
manual to get this work. mysql_query doesn't actually return the result, but
a resource id that can be used with mysql_fetch_xxx functions. Try this :

$link = mysql_connect("localhost","root","goobers") or die(mysql_error());
mysql_select_db("workorder", $link);
$result = mysql_query("SELECT SUM(`ElecRem`) AS  total FROM orders", $link);
$row = mysql_fetch_array($result);
$total=$row['total'];
echo $total;



"Brian E Boothe" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> why cant i get this to sum > ???
> <?
>                 $link = mysql_connect("localhost","root","goobers") or 
> die(mysql_error());
>                     mysql_select_db("workorder", $link);
>                      $result = mysql_query("SELECT SUM(`ElecRem`) AS total 
> FROM orders", $link);
>                             //$total = mysql_fetch_row($result);
>                                    echo mysql_result($result); // outputs 
> total
>                                  //return $total[0];
>                                   echo mysql_error();                  ?>
> 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to