Ver Mensaje Individual
  #3 (permalink)  
Antiguo 11/10/2012, 09:28
karma274
 
Fecha de Ingreso: septiembre-2012
Ubicación: Norte de Santander
Mensajes: 127
Antigüedad: 12 años, 5 meses
Puntos: 1
Respuesta: Php para actualizar bd mysql

Gracias Triby ya se que lo del mensaje no se puede pero como hago lo del contador...
Ahh por cierto mi codigo est asi:
Código PHP:
<?php
ini_set
('max_execution_time'300);
//Exportar datos de php a Excel
header("Content-Type: application/vnd.ms-excel");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("content-disposition: attachment;filename=Reportes.xls");
include(
"../../conexiones/conexion.php");

$rt mysql_query("SELECT * FROM tabla");
$ntotal mysql_num_rows($rt);
$rs mysql_query("SELECT * FROM tabla WHERE nmatricula = 0");
    while(
$registro mysql_fetch_assoc($rs)){
        require(
"../../conexiones/conexionSii.php");
        
$rf mysql_query("SELECT * FROM tabla WHERE numid=".$registro['cedula']." and estmatricula = 'MA' and fecmatricula >= '20120801'");
        while(
$fila mysql_fetch_assoc($rf)){
            if(
$fila['organizacion'] != 02){
            require(
"../../conexiones/conexion.php");
                
$q="UPDATE tabla SET 
                    nmatricula = '"
.$fila['matricula']."', 
                    fecha = '"
.$fila['fecmatricula']."' 
                    WHERE cedula = '"
.$fila['numid']."'
                    "
;
                    
mysql_query($q,$link) or die (mysql_error());
            }
        }
    }
require(
"../../conexiones/conexion.php");
$rs mysql_query("SELECT * FROM tabla WHERE nmatricula = 0");
$nregcero mysql_num_rows($rs);
$nregmat$ntotal-$nregcero;
?>
<html>
<head>
<title></title>
</head>
<table border="1">
<tr><td colspan="2"><b>REPORTE DE ACTUALIZACION DE MATRICULAS</b></tr>
<tr><td><b>REGISTROS TOTALES EN ACTA DE FORMALIZACION</b></td><td><?php echo $ntotal?></td></tr>
<tr><td><b>REGISTROS CON MATRICULAS</b></td><td><?php echo $nregmat?></td></tr>
<tr><td><b>REGISTROS CON MATRICULAS EN CERO</b></td><td><?php echo $nregcero?></td></tr>
<tr><td><b>MATRICULAS ACTUALIZADAS</b></td><td></td></tr>
</table>
</html>
Es completamente funcional pero no puedo hacer un contador ya intente con mysql_affected_rows pero no me funciona no se donde lo podria colocar para que funcione

Última edición por karma274; 11/10/2012 a las 09:44