Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/01/2017, 20:53
thelighter
 
Fecha de Ingreso: agosto-2011
Mensajes: 36
Antigüedad: 13 años, 6 meses
Puntos: 0
Respuesta: Actualizar varios registros a la vez en php y mysql

Cita:
<?php require ('../../Connections/agregarequipos.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;
}
}

$maxRows_Recordset1 = 1000;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

mysql_select_db($database_agregarequipos, $agregarequipos);
$query_Recordset1 = "SELECT * FROM clientes WHERE TIMESTAMPDIFF(DAY, fecha_final , CURDATE()) > 1";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $agregarequipos) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>






<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>Id</th>
<th>Nombre</th>
<th>Cell</th>
<th>Ip</th>

<th>Codigo</th>
<th>Fecha de Corte</th>
<th>Estado</th>
</tr>
</thead>
<tbody>


</tr>
<?php do { ?>
<tr>
<td><a href="http://www.forosdelweb.com/f18/Contenido/buscar_cl.php?id=<?php echo $row_Recordset1['id']; ?>"> <?php echo $row_Recordset1['id']; ?>&nbsp; </a></td>
<td><?php echo $row_Recordset1['nombres']; ?>
<?php echo $row_Recordset1['apellido']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['cell']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['ip']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['codigo']; ?>&nbsp;</td>

<td><?php echo $row_Recordset1['fecha_final']; ?>&nbsp; </td>
<td><?php echo $row_Recordset1['disable']; ?>&nbsp; </td>



</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>


</tbody>
<tfoot>
<tr>
<th>Id</th>
<th>Nombre</th>
<th>Cell</th>
<th>Ip</th>

<th>Codigo</th>
<th>Fecha de Corte</th>
<th>Estado</th>
</tr>
</tfoot>
</table>
esto me representa en una tabla los clientes vencidos con dos dias de vencidos ahora me gustaria que cada uno que se cumpla el plazo se envie un valor mediante post