recorrer registros repetidos
Publicado por alejon (117 intervenciones) el 15/04/2013 16:07:35
Buenas a todos, Como haria para recorrer un arreglo con registros repetidos y luego imprimirlos?
pudieran ayudarme. gracias
pudieran ayudarme. gracias
<?php
require('datos.php');
$datos=new CDatos('pg','localhost','postgres','1234','sala');
if ($datos->ExisteError)
exit($datos->MsjCompleto);
$fecha=date("d-m-Y");
$fede=new CDatos('pg','172.16.4.9','administrador','FEDE2013Infor*','fede');
if ($datos->ExisteError)
exit($datos->MsjCompleto);
$fecha=date("d-m-Y");
?>
<html>
<head>
<title>Planilla Planteles</title>
</head>
<body>
<?php
$sql="select * from public.escuelas where cod_est = '06'";
$arre = $datos->Registros('sala',$sql);
echo "Existen: ".count($arre)."<br>";
for($i=0; $i<count($arre);$i++){
$acum=0;
$marca = FALSE;
for($j=0; $j<count($arre);$j++){
if($primero == $arre[$j]["cod_dea"] && $ides != $arre[$j]["id_escuela"]){
echo $arre[$j]["cod_dea"]." - ";
echo $arre[$j]["id_escuela"];
echo "<br>";
$acum++;
$marca = TRUE;
}
}
if($marca==TRUE){
echo "Existen: ".$acum."<br>";
}
}
?>
</body>
</html>
<?php
require('datos.php');
$datos=new CDatos('pg','localhost','postgres','1234','sala');
if ($datos->ExisteError)
exit($datos->MsjCompleto);
$fecha=date("d-m-Y");
$fede=new CDatos('pg','172.16.4.9','administrador','FEDE2013Infor*','fede');
if ($datos->ExisteError)
exit($datos->MsjCompleto);
$fecha=date("d-m-Y");
?>
<html>
<head>
<title>Planilla Planteles</title>
</head>
<body>
<?php
$sql="select * from public.escuelas where cod_est = '06'";
$arre = $datos->Registros('sala',$sql);
echo "Existen: ".count($arre)."<br>";
for($i=0; $i<count($arre);$i++){
$primero = $arre[$i]["cod_dea"];
$ides = $arre[$i]["id_escuela"];
$acum=0;
$marca = FALSE;
for($j=0; $j<count($arre);$j++){
if($primero == $arre[$j]["cod_dea"] && $ides != $arre[$j]["id_escuela"]){
echo $arre[$j]["cod_dea"]." - ";
echo $arre[$j]["id_escuela"];
echo "<br>";
$acum++;
$marca = TRUE;
}
}
if($marca==TRUE){
echo "Existen: ".$acum."<br>";
}
}
?>
</body>
</html>