Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Eu sei que é algum erro na minha logica, mas nao consigo de jeito nenhum acertar.
Tenho duas colunas, e é para listar lado a lado os usuarios.
mas ele lista todos usuarios na coluna 1 como sendo o mesmo usuario, e na coluna 2, lista certinho
O erro acontece aqui nesse link: http://xurisso.amserver1.com/sessao/06/pessoas.php
usuario: teste@gmail.com
senha: teste
/applications/core/interface/imageproxy/imageproxy.php?img=http://xurisso.amserver1.com/sessao/ERRO.jpg&key=b4143dc6daf8680acfb78dd08a4b41f8bfbe327b0e603384b0644ec407238221" alt="ERRO.jpg" />
Código:
<form id="form1" name="form1" method="post" action="../processa.php">
<hr />
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40%">Pesquisar por pessoas:
<select name="filtrotipe" id="filtrotipe">
<option value="1"> Online </option>
<option value="2"> No seu grupo </option>
<option value="3"> Na sua cidade </option>
</select>
</td>
<td width="50%">contendo o codinome:
<input type="text" name="filtro_name" id="filtro_name" /></td>
<td width="10%"><input type="submit" name="pesquisaok" id="pesquisaok" value="Pesquisar" /></td>
</tr>
</table>
<hr />
<?php
$lista=2;
if ($lista==1){
// Seleciona todos usuarios online
$select = mysql_query("select * from dados_usuario where status='online' and lday='$_getdate' ORDER BY usuario ASC");
}
if ($lista==2){
// Seleciona usuarios online do grupo
$select = mysql_query("select * from usuarios where grupo='$grupo' and pessoa='fisica' ORDER BY usuario ASC");
}
//========================================
//(coluna 1) Captura de acordo com codigo a cima
while ($linha1 = mysql_fetch_assoc($select)) { /* CHAVE #1 */
$seleciona_usuario=$linha1['usuario'];
//(coluna 1) Puxa a foto do usuario
$puxasessao1 = mysql_query("select * from sessao_usuario where usuario='$seleciona_usuario'");
while ($linhasessao1 = mysql_fetch_assoc($puxasessao1)) { / CHAVE #2 /
$foto=$linhasessao1['avatar'];
$abre_foto1= '../' . $dir_avatarusuario . $foto;
//========================================
//(coluna 2) Captura de acordo com codigo a cima
while ($linha2 = mysql_fetch_assoc($select)) { /* CHAVE #3 */
$seleciona_usuario=$linha2['usuario'];
//(coluna 2) Puxa a foto do usuario
$puxasessao2 = mysql_query("select * from sessao_usuario where usuario='$seleciona_usuario'");
while ($linhasessao2 = mysql_fetch_assoc($puxasessao2)) { / CHAVE #4 /
$foto=$linhasessao2['avatar'];
$abre_foto2= '../' . $dir_avatarusuario . $foto;
//========================================
?></td></tr>
<tr><td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="#CCCCCC"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr class="apelido">
<td width="5%"><?php
echo '<div <p class="foto"><a href="'.$abre_foto1.'" rel="lightbox">
<img src="'.$abre_foto1.'" width="30" height="30" class="photo1" id="photo1" style="photo1" title="Abre foto" border="1" />
</a></div></td>';
?></td>
<td width="75%"><span style="width: 100px; font-family:'Courier New', Courier, monospace; font-size: 14px; text-align: left; padding: 0 8px;"> <?php echo ucwords($linhasessao1[usuario]); ?></span></td>
<td style="width: 100px; font-size: 18px; text-align: left; padding: 0 8px;"><input style="display: none;" name="varname" value="<?php echo $linhasessao1[usuario]; ?>" /></td>
<td style="width: 60px;"><input style="display: none;" name="pegaperfil" value="<?php echo $linhasessao1[usuario]; ?>" />
<input type="submit" class="botao1" name="perfil" value="Ver perfil" /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="50%"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="#CCCCCC"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr class="apelido">
<td width="5%"><?php
echo '<div <p class="foto"><a href="'.$abre_foto2.'" rel="lightbox">
<img src="'.$abre_foto2.'" width="30" height="30" class="photo1" id="photo1" style="photo1" title="Abre foto" border="1" />
</a></div></td>';
?></td>
<td width="75%"><span style="width: 100px; font-family:'Courier New', Courier, monospace; font-size: 14px; text-align: left; padding: 0 8px;"> <?php echo ucwords($linhasessao2[usuario]); ?></span></td>
<td style="width: 100px; font-size: 18px; text-align: left; padding: 0 8px;"><input style="display: none;" name="varname2" value="<?php echo $linhasessao2[usuario]; ?>" /></td>
<td style="width: 60px;"><input style="display: none;" name="pegaperfil2" value="<?php echo $linhasessao2[usuario]; ?>" />
<input type="submit" class="botao1" name="perfil2" value="Ver perfil" /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</form>
</td></tr><tr><td>
<?php
} / CHAVE #1 /
} / CHAVE #2 /
} / CHAVE #3 /
} / CHAVE #4 /
?>
</td></tr>
</table>
</td></tr>
<tr><td><hr/></td></tr>
<tr><td><a href="../01/usuario.php"></a></td></tr>
</table>
EDITADO:
É diferente este codigo que mexi, eu fiz uma correção no codigo anterior, e consegui desbugar a coluna 1.
Mas agora a coluna 2 nao aparece e eu não sei por que
/applications/core/interface/imageproxy/imageproxy.php?img=http://xurisso.amserver1.com/sessao/ERRO2.jpg&key=7f675ce08c31686dd29d4e74f028ed436935ec94a0ad985910684ed86d4e3117" alt="ERRO2.jpg" />
Código:
<form id="form1" name="form1" method="post" action="../processa.php">
<hr />
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40%">Pesquisar por pessoas:
<select name="filtrotipe" id="filtrotipe">
<option value="1"> Online </option>
<option value="2"> No seu grupo </option>
<option value="3"> Na sua cidade </option>
</select>
</td>
<td width="50%">contendo o codinome:
<input type="text" name="filtro_name" id="filtro_name" /></td>
<td width="10%"><input type="submit" name="pesquisaok" id="pesquisaok" value="Pesquisar" /></td>
</tr>
</table>
<hr />
<?php
$lista=2;
if ($lista==1){
// Seleciona todos usuarios online
$select = mysql_query("select * from dados_usuario where status='online' and lday='$_getdate' ORDER BY usuario ASC");
}
if ($lista==2){
// Seleciona usuarios online do grupo
$select = mysql_query("select * from usuarios where grupo='$grupo' and pessoa='fisica' ORDER BY usuario ASC");
}
?></td></tr>
<tr><td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%">
<?php
/ Inicio da coluna 1 /
//========================================
//(coluna 1) Captura de acordo com codigo a cima
while ($linha1 = mysql_fetch_assoc($select)) { /* CHAVE #1 */
$seleciona_usuario1=$linha1['usuario'];
//(coluna 1) Puxa a foto do usuario
$puxasessao1 = mysql_query("select * from sessao_usuario where usuario='$seleciona_usuario1'");
while ($linhasessao1 = mysql_fetch_assoc($puxasessao1)) { / CHAVE #2 /
$foto=$linhasessao1['avatar'];
$abre_foto1= '../' . $dir_avatarusuario . $foto;
//========================================
?>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="#CCCCCC"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr class="apelido">
<td width="5%"><?php
echo '<div <p class="foto"><a href="'.$abre_foto1.'" rel="lightbox">
<img src="'.$abre_foto1.'" width="30" height="30" class="photo1" id="photo1" style="photo1" title="Abre foto" border="1" />
</a></div></td>';
?></td>
<td width="75%"><span style="width: 100px; font-family:'Courier New', Courier, monospace; font-size: 14px; text-align: left; padding: 0 8px;"> <?php echo ucwords($linhasessao1[usuario]); ?></span></td>
<td style="width: 100px; font-size: 18px; text-align: left; padding: 0 8px;"><input style="display: none;" name="varname" value="<?php echo $linhasessao1[usuario]; ?>" /></td>
<td style="width: 60px;"><input style="display: none;" name="pegaperfil" value="<?php echo $linhasessao1[usuario]; ?>" />
<input type="submit" class="botao1" name="perfil" value="Ver perfil" /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<?php
} / CHAVE #1 /
} / CHAVE #2 /
?>
</td>
<td width="50%">
<?php
/ Inicio da coluna 2 /
//========================================
//(coluna 2) Captura de acordo com codigo a cima
while ($linha2 = mysql_fetch_assoc($select)) { /* CHAVE #3 */
$seleciona_usuario2=$linha2['usuario'];
//(coluna 2) Puxa a foto do usuario
$puxasessao2 = mysql_query("select * from sessao_usuario where usuario='$seleciona_usuario2'");
while ($linhasessao2 = mysql_fetch_assoc($puxasessao2)) { / CHAVE #4 /
$foto=$linhasessao2['avatar'];
$abre_foto2= '../' . $dir_avatarusuario . $foto;
//========================================
?>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="#CCCCCC"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr class="apelido">
<td width="5%"><?php
echo '<div <p class="foto"><a href="'.$abre_foto2.'" rel="lightbox">
<img src="'.$abre_foto2.'" width="30" height="30" class="photo1" id="photo1" style="photo1" title="Abre foto" border="1" />
</a></div></td>';
?></td>
<td width="75%"><span style="width: 100px; font-family:'Courier New', Courier, monospace; font-size: 14px; text-align: left; padding: 0 8px;"> <?php echo ucwords($linhasessao2[usuario]); ?></span></td>
<td style="width: 100px; font-size: 18px; text-align: left; padding: 0 8px;"><input style="display: none;" name="varname2" value="<?php echo $linhasessao2[usuario]; ?>" /></td>
<td style="width: 60px;"><input style="display: none;" name="pegaperfil2" value="<?php echo $linhasessao2[usuario]; ?>" />
<input type="submit" class="botao1" name="perfil2" value="Ver perfil" /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<?php
} / CHAVE #3 /
} / CHAVE #4 /
?>
</td>
</tr>
</table>
</form>
</td></tr><tr><td> </td></tr>
</table>
</td></tr>
<tr><td><hr/></td></tr>
<tr><td><a href="../01/usuario.php"></a></td></tr>
</table>Carregando comentários...