配列 a:
array ( 0 => array ( 0 => 'CVT121015001', ), 1 => array ( 0 => 'CVT121015002', 1 => 'CVT121226001', ),$val_3 = implode(",",$a[$k]);echo $val_3;//得到:CVT121015001CVT121015002,CVT121226001//如何让得到的值变成:‘CVT121015001’‘CVT121015002’,‘CVT121226001’
または既知の $val_3:
CVT121015001
CVT121015002,CVT121226001
それをクエリステートメントに組み込みます:
$sql = "select Lotno,count(lotno) as count from `table` where packageno in (.$value.) group by Lotno order by Lotno asc";それ?
$val_3 = "'" . implode("','",$a[$k]) . "'";
$res = '';
if(empty($res)){
}else{$res .= ",'".$val."'";