eeste es mi dolor de cabeza
Código PHP:
<html>
<body>
<?php
if (!isset($buscar)){
echo "Debe especificar una cadena a buscar";
echo "<p>Debe especificar una cadena a buscar</p> \n";
echo "<p><a href=buscaproducto.php>Volver</p> \n";
echo "</html></body> \n";
exit;
}
$link = mysql_connect("localhost", "");
mysql_select_db("manifiestos", $link);
$sql = "select item.merc,item.codaran,item.cant_merc,manifiesto.numan,manifiesto.fecha from item,manifiesto where item.manifiesto_numan='$buscar'";
$result = mysql_query($sql, $link);
if ($row = mysql_fetch_array($result)){
echo "<table border = '1'> \n";
echo "<tr> \n";
mysql_field_seek($result,0);
while ($field = mysql_fetch_field($result)){
echo "<td><b>$field->name</b></td>\n";
}
echo "</tr> \n";
while($row = mysql_fetch_array($result))
{
echo "<tr> \n";
echo "<td>".$row["codaran"]."</td> \n";
echo "<td>".$row["cant_merc"]."</td> \n";
echo "<td>".$row["numan"]."</td> \n";
echo "<td>".$row["fecha"]."</td> \n";
echo "</tr> \n";
};
echo "<p><a href=buscaproducto.php>Volver</p> \n";
echo "</table> \n";
} else {
echo "<p>¡No se ha encontrado ningún registro!</p>\n";
echo "<p><a href=buscaproducto.php>Volver</p> \n";
}
mysql_free_result($result);
mysql_close($link);
?>
</body>
</html>