$sql_wt_.$i="select count(*),sum(yjje) from app_jhpz where gs_jbrq like '2007-"."$i%' and j_dwmc='物探'";

解决方案 »

  1.   

    $sql_wt_{$i} = "select count(*),sum(yjje) from app_jhpz where gs_jbrq like '2007-".$i."%' and j_dwmc='物探'";
      

  2.   

    $sql_wt_{$i}="select count(*),sum(yjje) from app_jhpz where gs_jbrq like '2007-{$i}%' and j_dwmc='物探'";
      

  3.   

    ${sql_wt_.$i} = "select count(*),sum(yjje) from app_jhpz where gs_jbrq like '2007-".$i."%' and j_dwmc='物探'";
      

  4.   

    先把SELECT语句写出来,再把要加符号的部分加符号,仔细点就不会错了。