php - DISTINCT * is not withdrawing the duplicity (MYSQL) -
i done remove duplicity on database on selecting checkbox on sectio "bairros" utilized array
for($m=0; $m<count($_post["bairros"]); $m++){// loop 1 $pesquisar=($_post["bairros"][$m]); //copy bairros(array) , esporte (post) $query = "select distinct * cadastro (esporte1 = '".$_post["esportes"]."' or esporte2 = '".$_post["esportes"]."' or esporte3 = '".$_post["esportes"]."' or esporte4 = '".$_post["esportes"]."') , (bairro1 = '".$pesquisar."' or bairro2 = '".$pesquisar."' or bairro3 = '".$pesquisar."' or bairro4 = '".$pesquisar."') , ativaraparecer='sim' order nomecompleto asc limit 20"; $esporte= new consultar(); $esporte->executa($query); //loops for($l=0; $l<$esporte->nrw; $l++){ //loop 2 echo $esporte->data["nomecompleto"]."<br />"; $esporte->proximo(); } //close loop2 } //close loop1
- detail: function object oriented, believe i'm doing wrong @ sql or mysql, perhaps missing there.
select distinct *
stop there. distinct *
can what? duplicate of what? cant that. give field name see unique values.
for example
select distinct nomecompleto