Ok, I tried that (I knew it must have been something easy like that), but I get an error...
here's what I had changed the code to:
<?php
$total = 0;
$printr = mysql_query("SELECT totalSpent FROM project1 WHERE Preferences = 'rap' ");
while($row = mysql_fetch_array($printr)){
$total = $total + $row['totalSpent'];
}
and this is the error I get:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\apache group\Apache\htdocs\Project1.php on line 48
(line 48 is this line: while($row = mysql_fetch_array($printr)){
any ideas?
thanks again!