I have a table as follows
account
date
item1_0
item1_1
item1_2
item2_0
item2_1
item2_2
The item fields default to zero but can be any number
Now, what I want to do is something like this - but using sql:
PHP Code:
<?php
$count = 0;
foreach($item as $i)
{
if($i != 0)
{
$count++;
}
}
return $count;
?>
Any pointers would be greatly appreciated