Gracias !!
Este es el utilizo para el formulario
Código PHP:
Ver original<html>
<body>
<h1><center>
<p>AGREGA BIENES</p>
</center></h1>
<form action="crea_bienes.php" method="POST">
<div align="center">
<table width="415" border="0">
<!-- ******************************************************************************************* -->
<tr>
<td width="169" height="69">NO_INVENTARIO:</td>
<td width="236"><input name="inventario" type="text" size=30></td>
</tr>
<!-- *********************************************************************************************** -->
<tr>
<td height="61">DESCRIPCION:</td>
<td><input size=30 type="text" name="descripcion"></td>
</tr>
<!-- *********************************************************************************************** -->
<tr>
<td height="60">ESTADO FISICO: </td>
<td><select name="comboseleccion">
<option>Selecciona Estado Fisico </option>
<?php
include("config.php");
$link=Conectarse();
$query="SELECT * FROM estado_fisico";
if ($resultado)
{
$valor=$renglon['nombre_estado_fisico'];
echo "<option value=".$valor.">".$valor."</option>\n";
}
?>
</select></td></tr>
<!-- ************************************************************************************************** -->
<tr>
<td height="60">RESGUARDANTE:</td>
<td>
<select name="comboseleccion2">
<option>Selecciona Resguardante </option>
<?php
//include("config.php");
$link=Conectarse();
$query="SELECT * FROM resguardan";
if ($resultado)
{
$valor=$renglon['nombre_resguardante']; //.['apaterno_resguardante'].['amaterno_resguardante'];
//$valor3=$renglon3['apaterno_resguardante'];
//$valor4=$renglon4['amaterno_resguardante'];
//$valor5=$valor2.$valor3.$valor4;
echo "<option value=".$valor.">".$valor."</option>\n";
}
?>
</select></td></tr>
<!-- ************************************************************************************************** -->
<tr>
<td height="60">NIVEL:</td
><td>
<select name="comboseleccion3">
<option>Selecciona Nivel </option>
<?php
//include("config.php");
$link=Conectarse();
$query="SELECT * FROM niveles";
if ($resultado)
{
$valor=$renglon['nivel'];
echo "<option value=".$valor.">".$valor."</option>\n";
}
?>
<?php
?>
</select> </td></tr>
<!-- ************************************************************************************************** -->
<tr>
<td height="60">SECCIONES:</td>
<td>
<select name="comboseleccion4">
<option>Selecciona Seccion </option>
<?php
//include("config.php");
$link=Conectarse();
$query="SELECT * FROM secciones";
if ($resultado)
{
$valor=$renglon['nombre_seccion'];
echo "<option value=".$valor.">".$valor."</option>\n";
}
?>
</select> </td></tr>
<!-- ************************************************************************************************** -->
<tr>
<center> <td> <p> </p>
<p> </p>
<p><a href="modificar.php">Volver al Menu </a></p></td></center>
<td height="55" colspan="2"><center>
<p> </p>
<p> </p>
<p>
<input type="submit" name="Guardar">
</p>
</center></td>
</tr>
</table>
<h5> . . . Escribir en mayusculas . . .</h5>
</div>
</form>
</center>
</body>
</html>
y este para guardar los datos ....
Código PHP:
Ver original<?php
include("config.php");
$link = Conectarse();
$query = sprintf("SELECT no_inventario FROM bienes WHERE bienes.no_inventario='%s'", {
echo "El numero de inventario ya existe en la BD";
}
if($no_inventario==NULL|$descripcion==NULL|$estado_fisico==NULL|$resguardante==NULL|$nivel==NULL|$seccion==NULL)
{
echo "<center><b><h4>Uno o mas campos estan vacios, verifica bien tus datos </h4></b></center>";
echo '<center><b><a href="agregar_bienes.php">Volver</b></center></a>';
}
else
{
$query = sprintf("INSERT INTO bienes (no_inventario, descripcion, estado_fisico, resguardante, nivel, seccion) VALUES ('%s','%s','%s', '%s','%s','%s')", header('Location:modificar.php'); {
echo "Los datos han sido correctamente insertados";
}
else
{
echo "Error introduciendo los datos";
}
}
?>
El segundo se que esta mal porque de antemano estoy usando el codigo para text y no para
combo, agradeceria tu ayuda !!
GRacias !!