Does average only work with numeric charectors? I am trying to get the average name used from all my rows where the userid=userid from another query
sql=select name, id from table group by id
while $row {
$id=$row['id'];
sql=select name, AVG(name) as aname, id from sametable where id='$id' group by name
while $newrow
echo $newrow['cname'];
}}
outputs 0's instead of the average named used where id from my second query matches id from the first.