title: break a if inside a foreach () loope
body: <p>I'm wrapping up my website, but I've an issue with breaking
  if statement inside foreach statement,
   I want when a student try to pick a job that he/she already had chosen, the if() fail and break from the WHOLE foreach() loop, this is my code,the break inside the if() only break out the if(), not the whole foreach
   please please help me.
  thank you</p>
  
  <pre><code>foreach($_POST['JobId'] AS $i){
      $sqlCheckingBeofrAdding ="SELECT * FROM JobsLists  WHERE JobId = '".$i."' AND SSU = '".$SSU."' "; 
      $rs = mysqli_query($dbCIE ,$sqlCheckingBeofrAdding);
  
      $row1 =  mysqli_fetch_assoc($rs);
  
      if($row1 &gt; 0){ 
          echo "You Already Have this Job In your List";
          break; 
      } 
  
      //insert into junction table.. 
      $sqlUpdate = "UPDATE  Jobs  SET NoStudent=NoStudent-1  WHERE JobId = '" . $i . "'";
      $resultUpdate = mysqli_query($dbCIE,$sqlUpdate) or die(mysqli_error($dbCIE));
  
      $sqlInsert ="INSERT INTO JobsLists(`JobID` , `SSU`) VALUES(".$i.",'".$SSU."' )";
      $MyQuery=  mysqli_query($dbCIE, $sqlInsert) or die(mysqli_error($dbCIE));
  
  }
  </code></pre>