php - How can I skip a row when using mysql_fetch_assoc? -
i running query looks this:
select campaigns.id, lead_stats.camp_id, lead_stats.country, campaigns.name, sum(lead_stats.leads) lead, sum(lead_stats.clicks) click,truncate(100.0 * sum(lead_stats.leads) / sum(lead_stats.clicks), 1) conv_rate lead_stats join campaigns on campaigns.id = lead_stats.camp_id lead_stats.date > date_sub(now(), interval 24 hour) , lead_stats.from_product = 4 , lead_stats.camp_id not in ( select camp_id suspicious_offer_clears clear_until > '".date('y-m-d h:i:s')."' , alert_type = 3 ) group lead_stats.camp_id having (sum(lead_stats.leads) / sum(lead_stats.clicks)) < 0.1 order lead_stats.camp_id
it gets information not important question have. however, curious on how could, in sql statement, if statement on lead_stats.country. want see if country not equal "us", , if not equal "us" want see if sum(lead_stats.click) row greater 20. decided try in php template because not figure out how on mysql.
here have on template that.
<?php while ( $row = mysql_fetch_assoc($getconresult) ) { if($row['country'] != "us"){ if($row['click'] > 19){ //not sure here because less 20, not want include in output on table } }
so wondering how can skip record if not match criteria stated above. thinking use statement had confusion on front. appreciated!
because it's while
loop, should skip iteration
while ( $row = mysql_fetch_assoc($getconresult) ) { if($row['country'] != "us"){ if($row['click'] < 20){ continue; //skip next loop } }
Comments
Post a Comment