很多条数据要写入数据库比如if($a == 2){
         跳过这一条
               }代码应该怎么写,知道的大哥直接给完整代码,谢谢了

解决方案 »

  1.   

    if($a != 2){
             跳过这一条
                   }
      

  2.   

    if($a != 2){
             执行这一条
                   }
      

  3.   

    if($a != 2){
       mysql_query('insert into ...');
    }
      

  4.   

    如果是在循环体中的话continue就行了
      

  5.   


    foreach($xxx as $x){
         if($a == 2){
               continue;//如果符合这个要求,本次循环内的以下语句不再执行 开始下一次循环
         }
         mysql_query("xxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
    }
      

  6.   


    你要的代码如下:
    if($a == 2)
    {
    }
    else
    {
      //一堆代码
    }