Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/12/2011, 12:05
Avatar de JoSe__MiGuEl__
JoSe__MiGuEl__
 
Fecha de Ingreso: octubre-2011
Ubicación: Colombia
Mensajes: 51
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: Problema con un insert

truman_truman te posteo el código de forma resumida ya que es muy extenso ya que con este puedo insertar 10 registros a la misma vez...
Código HTML:
<!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=utf-8" />
<title>RECOLECCIÓN DE INFORMACION SECRETARIA DE BINESTAR SOCIAL</title>
<script language='javascript' src="calendario/popcalendar.js"></script> 
<link rel="stylesheet" href="style/style.css" type="text/css"></link>
</head>

<body>
<h1 align="center">RECOLECCIÓN DE INFORMACION SECRETARIA DE BINESTAR SOCIAL</h1>
<form id="form1" name="form1" method="post" action="insert.php">
<p>&nbsp;</p>

<table width="1347" border="1">
  <tr>
    <th width="187" scope="col">Numero de Ficha</th>
    <th width="224" scope="col">Dirección</th>
    <th width="224" scope="col">Vereda</th>
  </tr>
  <tr>
    <th scope="col"><input name="ficha" type="text" id="ficha" /></th>
    <th scope="col"><input name="direc" type="text"  id="direc" /></th>
    <th scope="col"><select name="vereda" id="vereda">
        <option selected="selected"></option>
        <option value="canaan">Canaán</option>
        <option value="cascabel">Cascabel</option>
        <option value="chaguani">Chaguaní</option>
        <option value="cedron">El Cedrón</option>
        <option value="plan">El Plan</option>
        <option value="arboleda">La Arboleda</option>
        <option value="dolores">La Dolores</option>
        <option value="germania">La Germania</option>
        <option value="herradura">La Herradura</option>
        <option value="linda">La Linda</option>
        <option value="morron">Morrón</option>
        <option value="mulatico">Mulatico</option>
        <option value="mulato">Mulato</option>
        <option value="ptbonito">Patio Bonito</option>
        <option value="snfransisco">San Francisco</option>
        <option value="tacamocho">Tacamocho</option>
      </select></th>
  </tr>
</table>

<p>&nbsp;</p>

<table width="100%" height="90%" border="1" align="center">
  <tr>
    <th width="62" height="60" scope="col">Apellidos</th>
    <th width="61" scope="col">Nombres</th>
    <th width="126" scope="col">Tipo de documento</th>
    <th width="72" scope="col">Nro del documento</th>
    <th width="72" scope="col">Fecha de nacimiento</th>
    <th width="34" scope="col">Edad</th>
    <th width="74" scope="col">Parentesco</th>
    <th width="50" scope="col">Estado civil</th>
    <th width="89" scope="col">Discapacidad</th>
    <th width="67" scope="col">Afiliación a salud</th>
    <th width="60" scope="col">Entidad de afiliación</th>
    <th width="74" scope="col">Esquema vacunación</th>
    <th width="50" scope="col">Estudia</th>
    <th width="76" scope="col">Nivel escolaridad</th>
    <th width="80" scope="col">Programa en salud</th>
    <th width="58" scope="col">Practica algún deporte</th>
    <th width="81" scope="col">Beneficiario programas sociales</th>
    <th width="76" scope="col">Programas Casa de la cultura</th>
    <th width="77" scope="col">Encuestado en el sisben</th>
    </tr>
  <tr>
    <th height="26" scope="col"><input name="apells1" type="text" id="apells1" size="12" /></th>
    <th scope="col"><input name="noms1" type="text" id="noms1" size="12" /></th>
    <th width="7" nowrap="nowrap" scope="col"><select name="tipdc1" id="tipdc1" style="width:81%">
        <option selected="selected"> </option>
        <option>No tiene</option>
        <option>Cédula de Ciudadanía</option>
        <option>Tarjeta de Identidad</option>
        <option>Cédula de Extranjería</option>
        <option>Registro Civil</option>
        </select></th>
    <th scope="col"><input name="doc1" type="text" id="doc1" size="9" /></th>
    <th scope="col"><input name="fech1" type="text" id="fech1" size="9" onClick="popUpCalendar(this, form1.fech1, 'yyyy-mm-dd');" /></th>
    <th scope="col"><input name="edad1" type="text" id="edad1" size="9" /></th>
    <th scope="col"><select name="parent1" id="parent1" style="width:81%">
        <option selected="selected"> </option>
        <option>Jefe</option>
        <option>Madre cabeza de hogar</option>
        <option>Cónyuge</option>
        <option>Hijos</option>
        <option>Nietos</option>
        <option>Padres</option>
        <option>Hermanos</option>
        <option>Yerno o Nuera</option>
        <option>Abuelos</option>
        <option>Suegros</option>
        <option>Tios</option>
        <option>Sobrinos</option>
        <option>Primos</option>
        <option>Cuñados</option>
        <option>Otros parientes</option>
        <option>No parientes</option>
        <option>Servicio domestico</option>
        </select></th>
    <th scope="col"><select name="estado1" id="estado1">
        <option selected="selected"> </option>
        <option>Unión libre</option>
        <option>Casado</option>
        <option>Viudo</option>
        <option>Separado</option>
        <option>Divorciado</option>
        <option>Soltero</option>
        </select></th>
    <th scope="col"><select name="discap1" id="discap1">
   	  <option selected="selected"> </option>
      <option>Si</option>
      <option>No</option>
      </select></th>
    <th scope="col"><select name="afilia1" id="afilia1" style="width:81%">
        <option selected="selected"> </option>
        <option>No tiene</option>
        <option>Régimen subsidiado</option>
        <option>Régimen especial</option>
        <option>Régimen contributivo</option>
        <option>Municipio</option>
        </select></th>
    <th scope="col"><select name="enti1" id="enti1" style="width:81%">
        <option selected="selected"> </option>
        <option>No tiene</option>
        <option>EPS-S</option>
        <option>Comfenalco</option>
        <option>SALUDCOOP EPS</option>
        <option>CAFESALUD EPS</option>
        <option>NUEVA EPS</option>
        <option>FMP</option>
        <option>Otros</option>
        </select></th>
    <th scope="col"><select name="esque1" id="esque1" style="width:81%">
        <option selected="selected"> </option>
        <option>Si</option>
        <option>No</option>
        </select></th>
    <th scope="col"><select name="stud1" id="stud1" style="width:81%">
        <option selected="selected"> </option>
        <option>Si</option>
        <option>No</option>
        </select></th>
    <th scope="col"><select name="nivel1" id="nivel1" style="width:81%">
        <option selected="selected"> </option>
        <option>Ninguno</option>
        <option>Primaria incompleta</option>
        <option>Primaria completa</option>
        <option>Bachillerato incompleto</option>
        <option>Bachillerato completo</option>
        <option>Técnica</option>
        <option>Tecnología</option>
        <option>Profesional</option>
        <option>Otros</option>
        </select></th>
    <th scope="col"><select name="salud1" id="salud1" style="width:81%">
        <option selected="selected"> </option>
        <option>No tiene</option>
        <option>Control de crecimiento</option>
        <option>Vacunación</option>
        <option>Planificación familiar</option>
        <option>Hipertensión</option>
        <option>Citologias</option>
        </select></th>
    <th scope="col"><select name="deport1" id="deport1" style="width:81%">
        <option selected="selected"> </option>
        <option>Ninguno</option>
        <option>Fútbol</option>
        <option>Baloncesto</option>
        <option>Voleibol</option>
        <option>Micro fútbol</option>
        <option>Otro</option>
        </select></th>
    <th scope="col"><select name="program1" id="program1" style="width:81%">
        <option selected="selected"> </option>
        <option>Ninguno</option>
        <option>Mana</option>
        <option>Adultos mayores</option>
        <option>Familias en acción</option>
        <option>Hogares comunitarios</option>
        <option>CORED</option>
        <option>RNA</option>
        <option>Restaurante escolar</option>
        </select></th>
    <th scope="col"><select name="cultura1" id="cultura1" style="width:81%">
        <option selected="selected"> </option>
        <option>No</option>
        <option>Danzas</option>
        <option>Música</option>
        <option>Artes plásticas</option>
        <option>Artes aplicadas</option>
        <option>Sistemas</option>
        <option>Biblioteca</option>
        </select></th>
    <th scope="col"><select name="sisbn1" id="sisbn1" style="width:81%">
        <option selected="selected"> </option>
        <option>Si</option>
        <option>No</option>
        </select></th>
    </tr>
</table>
<p>&nbsp;</p>
<input type="submit" value="Enviar"></input>
</form>
</body>
</html> 
Bueno la cosa con esto es que la parte de el numero de ficha y la dirección se insertan en la bd con los de mas campos pero vacíos, y en la fila de abajo con todos los campos insertado; y eso es lo que quiero evitar que haga.
__________________
\m/_ JoSe _\m/