i have a sign up and would like to add up the # of children in each age group
[code=php]<?php
include(“connectdb.php”);
mysql_connect(“$host”, “$username”, “$password”)or die(“cannot connect”);
mysql_select_db(“$db_name”)or die(“cannot select DB”);
$query = “SELECT COUNT(*) FROM familyparty WHERE age1=’Over18′ AND age2=’Over18′ AND age3=’Over18′ AND age4=’Over18′ AND age5=’Over18′ AND age6=’Over18′ “;
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo “”.$row[‘COUNT(*)’].””;
}
?>
the AND is not correct bec it will look for each solumn with the result and come back “0” which is does
so how do i get it to take from all columns