Foros del Web » Programando para Internet » PHP »

Saber que tabla contiene datos para hacer un insert.

Estas en el tema de Saber que tabla contiene datos para hacer un insert. en el foro de PHP en Foros del Web. Hola, tengo un formulario en el cúal ingreso datos en una tabla llamada DIR_USUARIOS, en ella hay un campo llamado NUM_DIR que es el campo ...
  #1 (permalink)  
Antiguo 25/10/2012, 09:08
Avatar de satjaen  
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 11 años, 7 meses
Puntos: 10
Saber que tabla contiene datos para hacer un insert.

Hola, tengo un formulario en el cúal ingreso datos en una tabla llamada DIR_USUARIOS, en ella hay un campo llamado NUM_DIR que es el campo que diferencia el número de dirección que puede tener cada cliente.En el trozo de formulario que pongo mas abajo se pueden meter hasta tres direcciones distintas.
Hay tres tablas con id distintos y lo que quiero es que al hacer el insert en la base de datos me ingrese según la tabla que este rellena y diferenciandolas.

Código PHP:
 <div id="TabbedPanels2" class="TabbedPanels">
            <ul class="TabbedPanelsTabGroup">
              <li class="TabbedPanelsTab" tabindex="0">Dirección</li>
              <li class="TabbedPanelsTab" tabindex="0">Dirección 2</li>
              <li class="TabbedPanelsTab" tabindex="0">Dirección 3</li>
            </ul>
            <div class="TabbedPanelsContentGroup">
              <div class="TabbedPanelsContent">
              <table width="100%" id="1">
                  <tr>
                    <th scope="col">Calle</th>
                    <th scope="col"><input name="CALLE" type="text" size="30"value="<?php echo $row_Recordset2['CALLE']; ?>" /></th>
                    <th scope="col">Nº</th>
                    <th scope="col"><input name="NUMERO" type="text" size="1"value="<?php echo $row_Recordset2['NUMERO']; ?>" />
                    EDF
                    <input name="EDIFICIO" type="text" size="1"value="<?php echo $row_Recordset2['EDIFICIO']; ?>" />
                    PTA
                    <input name="PUERTA" type="text" size="1"value="<?php echo $row_Recordset2['PUERTA']; ?>" />
                    PISO
                    <input name="PISO" type="text" size="1"value="<?php echo $row_Recordset2['PISO']; ?>" />
                    LTA
                    <input name="LETRA" type="text" size="1"value="<?php echo $row_Recordset2['LETRA']; ?>" /></th>
                </tr>
                     <tr>
                    <th scope="col">Localidad</th>
                    <th scope="col"><input name="POBLACION" type="text" size="30" value="<?php echo $row_Recordset2['POBLACION']; ?>" /></th>
                    <th scope="col">Provincia</th>
                    <th scope="col"><input name="PROVINCIA" type="text" size="30" value="<?php echo $row_Recordset2['PROVINCIA']; ?>" /></th>
                  </tr>
                  <tr>
                  <th scope="col">Email</th>
                    <th scope="col"><input name="EMAIL" type="text" size="30" value="<?php echo $row_Recordset2['EMAIL']; ?>"/></th>
                </tr>
              </table>
              </div>
              <div class="TabbedPanelsContent"> 
              <table width="100%" id="2">
                  <tr>
                    <th scope="col">Calle</th>
                    <th scope="col"><input name="CALLE" type="text" size="30"value="<?php echo $row_Recordset4['CALLE']; ?>" /></th>
                    <th scope="col">Nº</th>
                    <th scope="col"><input name="NUMERO" type="text" size="1"value="<?php echo $row_Recordset4['NUMERO']; ?>" />
                    EDF
                    <input name="EDIFICIO" type="text" size="1"value="<?php echo $row_Recordset4['EDIFICIO']; ?>" />
                    PTA
                    <input name="PUERTA" type="text" size="1"value="<?php echo $row_Recordset4['PUERTA']; ?>" />
                    PISO
                    <input name="PISO" type="text" size="1"value="<?php echo $row_Recordset4['PISO']; ?>" />
                    LTA
                    <input name="LETRA" type="text" size="1"value="<?php echo $row_Recordset4['LETRA']; ?>" /></th>
                </tr>
                     <tr>
                    <th scope="col">Localidad</th>
                    <th scope="col"><input name="POBLACION" type="text" size="30" value="<?php echo $row_Recordset4['POBLACION']; ?>" /></th>
                    <th scope="col">Provincia</th>
                    <th scope="col"><input name="PROVINCIA" type="text" size="30" value="<?php echo $row_Recordset4['PROVINCIA']; ?>" /></th>
                  </tr>
                  <tr>
                  <th scope="col">Email</th>
                    <th scope="col"><input name="EMAIL" type="text" size="30" value="<?php echo $row_Recordset4['EMAIL']; ?>"/></th>
                </tr>
              </table>
              </div>
              <div class="TabbedPanelsContent"> 
              <table width="100%" id="3">
                  <tr>
                    <th scope="col">Calle</th>
                    <th scope="col"><input name="CALLE" type="text" size="30"value="<?php echo $row_Recordset5['CALLE']; ?>" /></th>
                    <th scope="col">Nº</th>
                    <th scope="col"><input name="NUMERO" type="text" size="1"value="<?php echo $row_Recordset5['NUMERO']; ?>" />
                    EDF
                    <input name="EDIFICIO" type="text" size="1"value="<?php echo $row_Recordset5['EDIFICIO']; ?>" />
                    PTA
                    <input name="PUERTA" type="text" size="1"value="<?php echo $row_Recordset5['PUERTA']; ?>" />
                    PISO
                    <input name="PISO" type="text" size="1"value="<?php echo $row_Recordset5['PISO']; ?>" />
                    LTA
                    <input name="LETRA" type="text" size="1"value="<?php echo $row_Recordset5['LETRA']; ?>" /></th>
                </tr>
                     <tr>
                    <th scope="col">Localidad</th>
                    <th scope="col"><input name="POBLACION" type="text" size="30" value="<?php echo $row_Recordset5['POBLACION']; ?>" /></th>
                    <th scope="col">Provincia</th>
                    <th scope="col"><input name="PROVINCIA" type="text" size="30" value="<?php echo $row_Recordset5['PROVINCIA']; ?>" /></th>
                  </tr>
                  <tr>
                  <th scope="col">Email</th>
                    <th scope="col"><input name="EMAIL" type="text" size="30" value="<?php echo $row_Recordset5['EMAIL']; ?>"/></th>
                </tr>
              </table>
              </div>
            </div>
          </div>
Gracias.

Etiquetas: formulario, tabla, usuarios
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:47.