Ayuda PHP y MySQL
Publicado por Tammy (19 intervenciones) el 22/03/2007 22:01:18
Hola ante q todo buenas tardes... me dirijo a este medio ya q estoy un poco desesperada estoy tratando de hacer una consulta y no puedo, he utilizado ejemplos de internet y varias cosas mas y de ninguna manera funciona, este es uno de los tantos codigos que he hecho:
<?php include("conexion.php");
if (isset($_POST['Buscar'])) {
$sql = "SELECT * FROM almacen WHERE tipo = '{$_POST['tipo']}' ";
if(!$result = mysql_query($sql,$link)){
die("Error al tratar de ejecutar: $sql ". mysql_error());}
?>
</p>
</div>
<div align="center"></div></td>
</tr>
<tr>
<td width="42" height="38"> </td>
<td width="106"><div align="center"><strong>Código</strong></div></td>
<td width="111"><div align="center"><strong>Serial</strong></div></td>
<td width="255"><div align="center"><strong>Descripción</strong></div></td>
<td width="60"><div align="center"><strong>Estatus</strong></div></td>
<td width="64"><div align="center"><strong>Tipo</strong></div></td>
</tr>
<?php while ($row = mysql_fetch_array($result));{ ?>
<tr>
<td height="38"><div align="center">
<input name="cod_art" type="radio" value="<?php echo $row['cod_art']; ?>"/>
</div></td>
<td><?php echo $row['cod_art']; ?> </td>
<td><?php echo $row['serial']; ?> </td>
<td><?php echo $row['descripcion']; ?> </td>
<td><?php echo $row['estatus']; ?> </td>
<td><?php echo $row['tipo']; ?> </td>
</tr>
<?php }} ?>
Este es uno de los codigos,esto: '{$_POST['tipo']}' en este caso es un radiobutton ya intentado con una lista y obtengo el mismo resultado... Cuando le doy al boton buscar no aparece nada =S
Si pueden ayudarme lo agradeceria..
<?php include("conexion.php");
if (isset($_POST['Buscar'])) {
$sql = "SELECT * FROM almacen WHERE tipo = '{$_POST['tipo']}' ";
if(!$result = mysql_query($sql,$link)){
die("Error al tratar de ejecutar: $sql ". mysql_error());}
?>
</p>
</div>
<div align="center"></div></td>
</tr>
<tr>
<td width="42" height="38"> </td>
<td width="106"><div align="center"><strong>Código</strong></div></td>
<td width="111"><div align="center"><strong>Serial</strong></div></td>
<td width="255"><div align="center"><strong>Descripción</strong></div></td>
<td width="60"><div align="center"><strong>Estatus</strong></div></td>
<td width="64"><div align="center"><strong>Tipo</strong></div></td>
</tr>
<?php while ($row = mysql_fetch_array($result));{ ?>
<tr>
<td height="38"><div align="center">
<input name="cod_art" type="radio" value="<?php echo $row['cod_art']; ?>"/>
</div></td>
<td><?php echo $row['cod_art']; ?> </td>
<td><?php echo $row['serial']; ?> </td>
<td><?php echo $row['descripcion']; ?> </td>
<td><?php echo $row['estatus']; ?> </td>
<td><?php echo $row['tipo']; ?> </td>
</tr>
<?php }} ?>
Este es uno de los codigos,esto: '{$_POST['tipo']}' en este caso es un radiobutton ya intentado con una lista y obtengo el mismo resultado... Cuando le doy al boton buscar no aparece nada =S
Si pueden ayudarme lo agradeceria..
Valora esta pregunta


0