I want to count all occurrences of the @ symbol in the field, and initially I thought that LIKE '% @%' would be a way, but if the symbol appears in the field more than once this is considered only one.
What other method that I could use would count every event?
Thanks.
EDIT For those who need this, this is what I ended up using, what works.
$count = 0; $sql = mysql_query("SELECT LENGTH(field_name) - LENGTH(REPLACE(field_name,'@','')) AS 'occurs' FROM table_name WHERE field_name LIKE '%@%'"); while ($data = mysql_fetch_assoc($sql)) { $count += $data['occurs']; } echo $count;
source share