Lo estoy haciendo así, pero no me inserta nada:
Código HTML:
Ver original<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> <div class="TabbedPanelsContentGroup"> <div class="TabbedPanelsContent"> <th scope="col">Calle
</th> <input name="NUM_DIR[]" type="hidden" size="" value="1" /> <th scope="col"><input name="calle[]" type="text" size="30"value="" /></th> <th scope="col"><input name="numero[]" type="text" size="1"value="" /> EDF
<input name="edificio[]" type="text" size="1"value="" /> PTA
<input name="puerta[]" type="text" size="1"value="" /> PISO
<input name="piso[]" type="text" size="1"value="" /> LTA
<input name="letra[]" type="text" size="1"value="" /></th> <th scope="col">Localidad
</th> <th scope="col"><input name="poblacion[]" type="text" size="30" value="" /></th> <th scope="col">Provincia
</th> <th scope="col"><input name="provincia[]" type="text" size="30" value="" /></th> <th scope="col">Email
</th> <th scope="col"><input name="email[]" type="text" size="30" value=""/></th> <div class="TabbedPanelsContent"> <th scope="col">Calle
</th> <input name="NUM_DIR[]" type="hidden" size="" value="2" /> <th scope="col"><input name="calle[]" type="text" size="30"value="" /></th> <th scope="col"><input name="numero[]" type="text" size="1"value="" /> EDF
<input name="edificio[]" type="text" size="1"value="" /> PTA
<input name="puerta[]" type="text" size="1"value="" /> PISO
<input name="piso[]" type="text" size="1"value="" /> LTA
<input name="letra[]" type="text" size="1"value="" /></th> <th scope="col">Localidad
</th> <th scope="col"><input name="poblacion[]" type="text" size="30" value="" /></th> <th scope="col">Provincia
</th> <th scope="col"><input name="provincia[]" type="text" size="30" value="" /></th> <th scope="col">Email
</th> <th scope="col"><input name="email[]" type="text" size="30" value=""/></th> <div class="TabbedPanelsContent"> <th scope="col">Calle
</th> <input name="NUM_DIR[]" type="hidden" size="" value="3" /> <th scope="col"><input name="calle[]" type="text" size="30"value="" /></th> <th scope="col"><input name="numero[]" type="text" size="1"value="" /> EDF
<input name="edificio[]" type="text" size="1"value="" /> PTA
<input name="puerta[]" type="text" size="1"value="" /> PISO
<input name="piso[]" type="text" size="1"value="" /> LTA
<input name="letra[]" type="text" size="1"value="" /></th> <th scope="col">Localidad
</th> <th scope="col"><input name="poblacion[]" type="text" size="30" value="" /></th> <th scope="col">Provincia
</th> <th scope="col"><input name="provincia[]" type="text" size="30" value="" /></th> <th scope="col">Email
</th> <th scope="col"><input name="email[]" type="text" size="30" value=""/></th>
Código PHP:
<?php require_once('Connections/conexion.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
$id_aviso=$_POST['id_aviso'];
$poblacion = $_POST['poblacion'];
$provincia= $_POST['provincia'];
$calle = $_POST['calle'];
$numero = $_POST['numero'];
$edificio= $_POST['edificio'];
$puerta = $_POST['puerta'];
$piso = $_POST['piso'];
$letra= $_POST['letra'];
$email = $_POST['email'];
$NUM_DIR = $_POST['NUM_DIR'];
$total = count($poblacion);
for ($i = 0; $i < $total; $i++) {
$poblacion = $poblacion[$i];
$provincia = $provincia[$i];
$calle = $calle[$i];
$numero = $numero[$i];
$edificio = $edificio[$i];
$puerta = $puerta[$i];
$piso = $piso[$i];
$letra = $letra[$i];
$email = $email[$i];
$NUM_DIR = $NUM_DIR[$i];
echo "INSERT INTO dir_usuarios VALUES (id_aviso,'$poblacion', '$provincia', '$calle','$numero', '$edificio', '$puerta','$piso', '$letra', '$email', '$NUM_DIR')";
}
mysql_select_db($database_conexion, $conexion);
$query_usuarios = "SELECT *
FROM usuarios WHERE id_aviso='$id_aviso'";
$usuarios = mysql_query($query_usuarios, $conexion) or die(mysql_error());
$row_usuarios = mysql_fetch_assoc($usuarios);
$totalRows_usuarios = mysql_num_rows($usuarios);
mysql_select_db($database_conexion, $conexion);
$query_Recordset2 = "SELECT * FROM dir_usuarios where id_aviso='$id_aviso' AND NUM_DIR='1'";
$Recordset2 = mysql_query($query_Recordset2, $conexion) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
?>