This code doesnt make much sence to me
$queryx = "SELECT count(*) FROM mytable WHERE e='".$_GET['e']."'";
$resultx = mysql_query($queryx);
while($row = mysql_fetch_assoc($resultx)) {
$ec2 = $row['count(*)'] / 3;
Since the select will only return one row there is no need for the while. You can do it like this instead:
$queryx = "SELECT count(*) n FROM mytable WHERE e='".$_GET['e']."'";
$resultx = mysql_query($queryx);
$row = mysql_fetch_assoc($resultx) ;
$ec2 = $row['n'] / 3;
or
$queryx = "SELECT somefield FROM mytable WHERE e='".$_GET['e']."'";
$resultx = mysql_query($queryx);
$n = mysql_num_rows($resultx);
$ec2 = $n / 3;