TCPDF - printing table from mysql

前端 未结 4 1118
情书的邮戳
情书的邮戳 2021-01-01 01:19

in my php,

while($info3 = mysql_fetch_array($result3)){
$Name = $info3[\"Name\"];
$Address = $info3[\"Address\"];
$Age = $info3[\"Age\"];
// ----------------         


        
4条回答
  •  别那么骄傲
    2021-01-01 02:02

    If what you mean is you want one table that includes all the results as rows, only loop the row printing and migrate the opening and closing tags outside the loop.

    $tbl = '';
    
        while($info3 = mysql_fetch_array($result3)){
        $Name = $info3["Name"];
        $Address = $info3["Address"];
        $Age = $info3["Age"];
    
        $tbl .= ''
         }
    $tbl .= '
    '.$Name.' '.$Age.' '.$Address.'
    '; $pdf->writeHTML($tbl, true, false, false, false, '');

提交回复
热议问题