ok heres what i am doing i have a table in my data base that has about 35 different rows of data in it(theyare all "int"). what i am doing is i am useing a search script to pull about 5 of those rows out and what i need help with is i need to add all those rows up to give me a total any help would be welcome
Here is my code
$SQL = "SELECT * FROM cart WHERE account='account'";
$retid4 = mysql_db_query($db, $SQL, $cid);
if (!$retid4) { echo( mysql_error()); }
else {
while ($row8 = mysql_fetch_array($retid4)) {
$price56 = $row8["price1"];
$SQL = "SELECT SUM * FROM cart WHERE price1='$price56'";
$retid6 = mysql_db_query($db, $SQL, $cid);
if (!$retid6) { echo( mysql_error()); }
else {
while ($row9 = mysql_fetch_array($retid6)) {
if ($_SESSION["loginid"]==2) {echo "<ul><li>$row9</li></ul>\n";}
else {
echo "Please Login To See Your Shopping Cart!!";
};}}
Thanks