El problema es que tarda en entra el foreach no se si me explico es decir si pongo por primera vez x numero en el buscador me tira este error
Código PHP:
Warning: Invalid argument supplied for foreach() in /home/tacopnet/public_html/pdf/consu.php on line 342
Repito el proceso es decir me regreso al buscador pongo x id y por fin me localiza las imagenes y datos correspondientes al id a que se debe este problema este es mi codigo
Código PHP:
foreach ( $ids as $idimg) --[COLOR="Red"]En esta linea me tira el error[/COLOR]
{
echo "<table border='1' cellspacing='2' cellpadding='6'>";
echo "<tr>";
echo "<th>";
echo "<input type='text' name='ruta[]' value='$idimg' />"; //aca genero tantos hidden como imagenes haya
echo "</th>";
echo "</tr>";
echo "</table>";
echo "</FORM>";
}
Código PHP:
$b=$_POST['caja1'];
$result=mysql_db_query("tacopnet_tacop","select * from imagenes where A66 LIKE '%{$b}%' ",$conec);
//Mostramos los registros
$contador=0;
while ($row=mysql_fetch_assoc($result))
{
echo '<img src="'.$row['ruta'].'" width="50%" height="50%">';
echo '</img>';
$ids[$contador]=$row['A66'];
$contador++;
}
mysql_free_result($result);
mysql_close($conec);
echo "<p>";
$conec1=mysql_connect("10.33.143.3","tacopnet_root","y+y-u*u/");
$c=$_POST['caja1'];
$result1=mysql_db_query("tacopnet_tacop","select A1,A10,A11,A12,A13,A14,A15,A18,A19,A32 from finiquito where A66 LIKE '%{$c}%' ",$conec1);
while ($row1=mysql_fetch_array($result1))
{
echo "<table border='1' cellspacing='2' cellpadding='6'>";
echo "<tr>";
echo "<th>";
echo "Numero de Folio";
echo "</th>";
echo "<th>";
echo "Nombre";
echo "</th>";
echo "<th>";
echo "Domicilio";
echo "</th>";
echo "<th>";
echo "Colonia";
echo "</th>";
echo "<th>";
echo "Fecha de Inicio";
echo "</th>";
echo "<th>";
echo "Fecha de Terminacion";
echo "</th>";
echo "<th>";
echo "Asesor Tecnico";
echo "</th>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo " ".$row1['A1']. " ";
echo "</td>";
echo "<td>";
echo " ".$row1['A10']." ";
echo " ".$row1['A11']." ";
echo " ".$row1['A12']." ";
echo "</td>";
echo "<td>";
echo " ".$row1['A13']." ";
echo " ".$row1['A14']." ";
echo "</td>";
echo "<td>";
echo " ".$row1['A15']." ";
echo "</td>";
echo "<td>";
echo " ".$row1['A18']." ";
echo "</td>";
echo "<td>";
echo " ".$row1['A19']." ";
echo "</td>";
echo "<td>";
echo " ".$row1['A32']." ";
echo "</td>";
echo "</tr>";
echo "</table>";
}
mysql_free_result($result1);
mysql_close($conec1);
?>
<?
echo "<FORM method='post' action='reportepdf.php' target='jose' onsubmit='jose = window.open(this.action , 'jose' , 'width=2000,height=2000')'>";
echo "<input type='submit' name='submit' value='Obtener Pdf'>";
echo "<input type='hidden' name='A66' id='A66' value='$c' />";