Hello Again, I need to add up the totals from 3 different colums I was wondering if I have to print this out for each one? or if I can do it in one shot?
This is what I need to do.
This is how Im performing it for now.. unless you guys can help me do it better.PHP Code:SELECT SUM(kills) AS mod_kills from item WHERE idnub = 3040 OR idnub = 3041
SELECT SUM(deaths) AS mod_deaths from item WHERE idnub = 3040 OR idnub = 3041
SELECT SUM(shots) AS mod_shots from item WHERE idnub = 3040 OR idnub = 3041
PHP Code:<?php
// Requesting a Search for User Info
$result = @mysql_query("SELECT SUM(kills) AS mod_kills from item WHERE idnub = 3040 OR idnub = 3041");
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
// Displays the results
while ( $row = mysql_fetch_array($result) ) {
$mod_kills = ($row["mod_kills"]);
}
?>
<? echo ($mod_kills); ?>




Bookmarks