hey, I need to break for(){} but just for one round, it means something like for ($i=1;$<51;$i++) { $q = mysql_fetch_assoc(mysql_query("SELECT * FROM something WHERE postid = (SELECT postid FROM something LIMIT 1)")); if ($q['postid'] >Â 100) { //do something } else{ //do something mysql_query("DELETE FROM something WHERE postid = ".$q['postid']); /////////////////BREAK HERE, BUT HOW? (because I have deleted it already) } mysql_query("DELETE FROM something WHERE postid = ".$q['postid']); //MORE MORE MORE QUERIES PHP: I just want one-round break! So for () continues'!
Use the continue statement: for ($i=1;$<51;$i++) { if($i == 1){ continue;} PHP: Basically if i is 1, skip this loop and go to the next condition -> i = 2.
exit; is totally different from break; and not applicable in this case. You need to look at your logic, not a new operator or function. If you only want those if statements to be run the first time round just check the value of $i.