Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/10/2012, 14:12
alex760125
 
Fecha de Ingreso: enero-2010
Mensajes: 239
Antigüedad: 14 años, 4 meses
Puntos: 0
Problema con incremento de variables.

Disculpen lo que voy a pedirles pero estoy agotado... Revisen el tema que puse en Mysql SELECT sin repetidos, acá les pongo el código php abreviado porque todo no se puede. Necesito ayuda!

Este es el incremento que le hago a las variables y las consultas.

class ContarEstrellas extends Conectar
{

protected $euno=0;
protected $edos=0;
protected $etres=0;
protected $ecuatro=0;
protected $ecinco=0;
protected $eseis=0;
protected $esiete=0;
protected $eocho=0;
protected $enueve=0;
protected $ediez=0;
protected $eonce=0;

//*****************************
protected $exx;
protected $enum_resultados;
//******************************
protected $epp=array();
protected $eyy=array();
//*********************************************
public function Econsulta()
{
$ebuscar = "SELECT jugadados.esuno,jugadados.esdos FROM jugadados ORDER BY jugadados.jugaid";

$this->exx = mysql_query($ebuscar,$this->db);

echo mysql_error($this->db);

$this->enum_resultados = mysql_num_rows($this->exx);


}
//**************************************************

public function Eincremento()
{
for($i=0; $i<$this->enum_resultados; $i++)
{
$eec = mysql_fetch_array($this->exx);
while($eelementos = each($eec))
{
switch($eelementos["value"])
{
case 1:
$this->euno = $this->euno+1;
break;
case 2:
$this->edos = $this->edos+1;
break;
case 3:
$this->etres = $this->etres+1;
break;
case 4:
$this->ecuatro = $this->ecuatro+1;
break;
case 5:
$this->ecinco = $this->ecinco+1;
break;
case 6:
$this->eseis = $this->eseis+1;
break;
case 7:
$this->esiete = $this->esiete+1;
break;
case 8:
$this->eocho = $this->eocho+1;
break;
case 9:
$this->enueve = $this->enueve+1;
break;
case 10:
$this->ediez = $this->ediez+1;
break;
case 11:
$this->eonce = $this->eonce+1;
break;
}
}
}
}

//************************************************** ****
public function EcreaTabla()
{

$ekkk = array($this->euno, $this->edos, $this->etres, $this->ecuatro, $this->ecinco, $this->eseis, $this->esiete, $this->eocho, $this->enueve, $this->ediez, $this->eonce);

foreach ($ekkk as $ek1 => $ev1) {
foreach ($ekkk as $ek2 => $ev2) {
if ($ek1 != $ek2) {
if ($ev1 == $ev2) {
unset($ekkk[$ek1]);

}
}
}
}

$this->epp = array_values($ekkk);

asort($this->epp);


$this->eyy = array(1=>$this->euno, 2=>$this->edos, 3=>$this->etres, 4=>$this->ecuatro, 5=>$this->ecinco, 6=>$this->eseis, 7=>$this->esiete, 8=>$this->eocho, 9=>$this->enueve, 10=>$this->ediez, 11=>$this->eonce);

}

Última edición por alex760125; 15/10/2012 a las 14:26