Php 错误的pdf与DOMPDF

Php 错误的pdf与DOMPDF,php,mysql,pdf,dompdf,Php,Mysql,Pdf,Dompdf,我正在尝试生成一个.pdf文件。但我无法连接我的文本: 这是我的代码: <?php include('conexion.php'); $con = conexion(); $sql="select * from [my table] where [condition] "; $res=mysql_query($sql,$con); $concli=conexion(); $sqlcli="select * from [my table] where [condition]"; $r

我正在尝试生成一个.pdf文件。但我无法连接我的文本: 这是我的代码:

<?php 
include('conexion.php');
$con = conexion();
$sql="select * from [my table] where [condition] ";
$res=mysql_query($sql,$con);

$concli=conexion();
$sqlcli="select *  from [my table] where [condition]";

$rescli=mysql_query($sqlcli,$concli);
$datocli=mysql_fetch_array($rescli);
$codigoHTML='
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>PDF</title>
</head>
<body>

<form>
<div align="left">
<img src="images/logo.jpg" width="186" height="88" alt="playss.net"/> </div><br/>
<hr />
<div >
<pre>
Nombre del cliente:  <input type="text" value="'; //HERE I'M TRYING TO CONCATENATE
echo $datocli['nomempresacli'];
$codigoHTML='
">
Nombre del Vendedor  <input type="text" value="">
Proyecto:            <input type="text" >
Fecha:               <input type="text" >
</pre>
<table width="95%" height="100%" border="1">
<tr height="40">
<td>#</td>
<td >Id Producto</td>
<td >Parte</td>
<td >Descripci&oacute;n</td>
<td >Cantidad</td>
<td >Precio</td>
<td >Subtotal</td>
<td >Descuento</td>
<td >total</td>
</tr>';
require_once("dompdf/dompdf_config.inc.php");

$contador=1;

while ($dato=mysql_fetch_array($res))
{
$codigoHTML.='
      <tr>
        <td>'.$contador.'</td>
        <td>'.$dato['idproducto'].'</td>
        <td>'.$dato['parte'].'</td>
        <td>'.$dato['descripcion'].'</td>
        <td>'.$dato['cantidad'].'</td>
        <td>'.$dato['precio'].'</td>
        <td>'.$dato['subtotal'].'</td>
        <td>'.$dato['descuento'].'</td>
        <td>'.$dato['total'].'</td>
      </tr>';
      $contador++;
      } 
$codigoHTML.='
    </table>
</div>
<pre>
<div align="right">
Total Final:  <input type="text" >
</div>
</pre>
<br/>
<hr/>


</form>

</body>
</html>
';

$codigoHTML=utf8_decode($codigoHTML);
$dompdf=new DOMPDF();
$dompdf->load_html($codigoHTML);

ini_set("memory_limit","128M");
$dompdf->render();
$dompdf->stream("cotizacion.pdf");
?>

错误是您没有联系正确启用最终HTML结果:

如下所示:

客户名称:
本德尔本德尔酒店

Proyecto:WARNING:
mysql\u query
是一个过时的接口,不应在新的应用程序中使用,因为它将在未来的PHP版本中删除。一个现代的替代品。如果你是PHP新手,像这样的指南可以帮助你解释最佳实践。@tadman我会考虑的,谢谢。你没有附加/连接任何东西。您只需重新分配
$codigoHTML
变量。要附加/连接,请使用
=
操作符,如
$codigoHTML.=“一些文本”进行赋值。此外,回显变量将其作为输出发送给用户,而不是附加到字符串中。您还可以使用带有变量的
=
进行追加。
Nombre del cliente:  <input type="text" value="'; //HERE I'M TRYING TO CONCATENATE
echo $datocli['nomempresacli'];
$codigoHTML='
">
Nombre del cliente:  <input type="text" value="'; //HERE I'M TRYING TO CONCATENATE
$codigoHTML.= $datocli['nomempresacli'];
$codigoHTML.= '
">
Nombre del Vendedor  <input type="text" value="">
Proyecto:            <input