私はこれに似た刺し傷を持っています
$_POST["ids"]='ABC,DEF,GHI'
3 つの変数をそれぞれ分離し、分離された結果を while ループで実行したいと考えています。
foreach( explode( ',', $_POST["ids"]) as $Client_ID)
{
  $sql_qry="select *
            from   ca_client_statement
            where  client_id='".$Client_ID."' and trading_period_month like '".$TP_Month."'";
  $sql_err_no=sql_select($sql_qry,$sql_res,$sql_row_count,$sql_err,$sql_uerr);
  $row = mysql_fetch_assoc($sql_res);
  $bytes = $row['pdf_statement'];
  header("Content-type: application/pdf");
  header('Content-disposition: attachment; filename="'.$Client_ID.'statement'.$TP_format.'.pdf"');
  print $bytes;
}  
これは、ABC のステートメントのみを生成します。3つではありません
どうもありがとう