Karl DeSaulniers wrote:
Would it be?

$q = "SUM(ProductStock) FROM products";


$q = "SELECT SUM(ProductStock) AS ProductStock FROM products";

if I want to return $ProductStock as the value?

This one.

The "AS" gives it an alias (or shortcut) to make it easier to find in mysql_fetch_array etc.

Postgresql & php tutorials

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to