select id from table1 where date like'"+copy(nowdatestr,1,7)+"+"%"'

解决方案 »

  1.   

    用like  不能用  = 上面的写法 怎么出来个copy ??
      

  2.   

    什么上下文环境调用mysql的?单说mysql语句的话,这样吧:"select i from table1 where month(date)=month('"+nowdatestr+"')";
      

  3.   

    上面错了点点:
    "select id from table1 where month(date)=month('"+nowdatestr+"')";记得给分哈!!
      

  4.   

    我的建议:
    $date1=date("M");
    $date2=date("Y");
    $date=$date2."-".$date1;
    然后查询
    浅妄薄见,望与斟酌
      

  5.   

    select id from table1 where date like '2002-05%'
    至於 '2002-05' 的產生,隨便你用 Mysql 或 php 的函數 (substr) 來實現了.