<?php
$arr=array('Guest@','Public@','Office@','Power@');
for($i=0;$i<=count($arr);$i++){
$select=mysql_query("select * tb_example WHERE ac_name LIKE '%".$arr[$i]."%'") or die (mysql_error());
echo $arr[$i]." : ".$num=mysql_num_rows($select);
}
?>
SELECT
(SELECT COUNT(*) FROM your_table WHERE ac_name LIKE 'Guest@%') AS guest_count,
(SELECT COUNT(*) FROM your_table WHERE ac_name LIKE 'Public@%') AS public_count,
(SELECT COUNT(*) FROM your_table WHERE ac_name LIKE 'Power@%') AS power_count