0
我正尝试从MPDF文件中的数据库中写入内容。我需要做一个循环,但我不能在“WriteHTML”部分内部完成,因为它不会识别为PHP代码。 如果我打印循环外的变量,它将无法识别整个数组。通过MPDF上的循环从Mysql获取变量
<?php
session_start();
$id = $_SESSION['id'];
$email = $_SESSION['email'];
$pass = $_SESSION['pass'];
$nivel = $_SESSION['nivel'];
$funcao = $_SESSION['funcao'];
$area = $_SESSION['area'];
$nome = $_SESSION['nome'];
$apelido = $_SESSION['apelido'];
$chefe = $_SESSION['chefe'];
include 'includes/connect.php';
$id = $_SESSION['id'];
include "mpdf/mpdf.php";
这里是循环:
$pc=mysql_query("SELECT * from pp where id_user=$id");
$row = array();
while ($data = mysql_fetch_array($pc)) $row[] = $data;
foreach ($row as $x){
$id_producto = $x[0];
$nome = $x[1];
$preco = $x[2];
$descricao = $x[3];
}
而其余的...
$html="
<center><img src='imagens/logo.png' width='100' height='100'></center>
<center><h3>Curriculo</h3></center>
Nome: $nome $apelido <br>
E-Mail: $email <bR>
Função: $funcao <br>
Área: $area <br>
Chefia: $chefe <br>
<h1>titulo</h1>
";
$mpdf=new mPDF();
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;
?>
感谢
非常感谢您!它的工作:) – user3536315
你非常欢迎(: – Skewled