Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/08/2010, 14:22
Avatar de Heiroon
Heiroon
 
Fecha de Ingreso: junio-2010
Ubicación: Caracas, Venezuela - Por ahora...
Mensajes: 495
Antigüedad: 13 años, 10 meses
Puntos: 63
Exclamación Query Was Empty

Buenas tardes, necesito ayuda colegas... Sinceramente no tengo ni idea de que ocurre en esta pagina... les voy a dejar el codigo para ver si me pueden ayudar.. lo unico que se es q me sale "Query Was Empty"...

Código PHP:
Ver original
  1. $registros =7;
  2. $pagina= $_SESSION['pagina'];
  3. $inicio = ($pagina - 1) * $registros;
  4. if($_SESSION['id_usuario']!=43){
  5.     $sql = "select * from usuarios where id_usuario <> ".$_SESSION['id_usuario']." and id_usuario <> '43' ".$where.$order;
  6. }else{
  7.     $sql = "select * from usuarios ".$where.$order;
  8. }
  9. $num= 0;
  10. $lista=mysql_query($sql)or die(mysql_error());
  11.     //echo $sql;
  12. $total_registros = mysql_num_rows($lista);
  13. $total_paginas= ceil($total_registros/$registros);
  14. if($pagina>$total_paginas){ $pagina=$total_paginas; }
  15. $sql .= "  LIMIT $inicio, $registros ";
  16. $lista=mysql_query($sql)or die(mysql_error());
  17. ?>
  18. <table width="100%" cellpadding="0" cellspacing="0" border="0" class="resultados">
  19.     <thead>
  20.         <tr>
  21.             <th colspan="6" align="center" ><div id="msjagr" style="margin-left:auto; margin-right:auto; font-size:12px; width:100%" ><?=$mensaje?></div></th>
  22.         </tr>
  23.         <tr>
  24.         <?
  25.             $funbas="llamarasincrono('usuarios/listarUsuarios.php";
  26.             if($_REQUEST['where']!=""){ $funbas.="&where=".$_REQUEST['where']; }
  27.             $funorn="ordern=1&byn=asc";
  28.             $funoru="orderu=1&byu=asc";
  29.             $funore="ordere=1&bye=asc";
  30.             $funors="orders=1&bys=asc";
  31.                 if($_REQUEST['ordern']==1){ if($_REQUEST['byn']=="asc"){ $ordern=1; $byn="desc"; }else{ $ordern=0; $byn=""; } $funorn="ordern=".$ordern."&byn=".$byn; }
  32.                 if($_REQUEST['ordere']==1){ if($_REQUEST['bye']=="asc"){ $ordere=1; $bye="desc"; }else{ $ordere=0; $bye=""; } $funore="ordere=".$ordere."&bye=".$bye; }
  33.                 if($_REQUEST['orderu']==1){ if($_REQUEST['byu']=="asc"){ $orderu=1; $byu="desc"; }else{ $orderu=0; $byu=""; } $funoru="orderu=".$orderu."&byu=".$byu; }
  34.                 if($_REQUEST['orders']==1){ if($_REQUEST['bys']=="asc"){ $orders=1; $bys="desc"; }else{ $orders=0; $bys=""; } $funors="orders=".$orders."&bys=".$bys; }
  35.                
  36.                 //echo $funbas."&".$funorc."&".$funort;
  37.             ?>
  38.             <th width="5%" ></th>
  39.             <th width="25%"><span><a class="<?=$classn?>" onclick="<?=$funbas?>?<?=$funorn?>', 'divforma');"  href="javascript:void(0);" >Nombre</a></span></th>
  40.             <th width="15%"><span><a href="javascript:void(0);"  class="<?=$classu?>" onclick="<?=$funbas?>?<?=$funoru?>', 'divforma');" >Usuario</a></span></th>
  41.             <th width="25%"><span><a href="javascript:void(0);"  class="<?=$classe?>" onclick="<?=$funbas?>?<?=$funore?>', 'divforma');" >Email</a></span></th>
  42.             <th width="15%" style="border-right:none;"><a href="javascript:void(0);"  class="<?=$classb?>" onclick="" >Tipo Usuario</a></th>
  43.             <th width="15%" style="border-right:none;"><span><a href="javascript:void(0);"  class="<?=$classs?>" onclick="<?=$funbas?>?<?=$funors?>', 'divforma');" >Estatus</a></span></th>
  44.         </tr>
  45.     </thead>
  46.    
  47.     <tfoot>
  48.         <tr>
  49.             <td colspan="6">
  50.             <div  style="display:inline; float:left; padding-right:10px; width:80px;">Pagina <?=$pagina?> de <?=$total_paginas?> </div>
  51.            
  52.             <?
  53.    $tpg=10;
  54.     if(($tpg%2) != 0){
  55.         $men= round($tpg/2)-1;
  56.         $men2= round($tpg/2)-1;
  57.     }else{
  58.         $men = round($tpg/2);
  59.         $men2 = round($tpg/2)-1;
  60.     }  
  61. $filtro="";
  62. if($where!=""){
  63.     $filtro=$_REQUEST['where']."&";
  64.     //
  65.     //echo $fitro;
  66. }
  67. if($orden!=""){
  68.     $ord=$orden."&";
  69.     //echo $fitro;
  70. }
  71.  
  72. $comj="";
  73.  
  74. $href1= "javascript:llamarasincrono('usuarios/listarUsuarios2.php?".$filtro.$ord."pagina=";
  75. $href2="' ,'divforma' );";
  76. // editar total de registros
  77. if($total_paginas>1)
  78. {
  79.     echo "<div style='display:inline;margin-left:-180px; text-align:center'>";
  80.     if(( $pagina - 1) > 0)
  81.     { $ant= $pagina - 1;
  82.         ?>
  83.         <a href="<?=$href1."1".$href2?>" style="text-decoration:none;">&laquo;Primero</a>
  84.         &nbsp;&nbsp;
  85.         <a href="<?=$href1.$ant.$href2?>" style="text-decoration:none;">&lt;Anterior</a>
  86.         <?
  87.     }else{
  88.     ?>
  89.         <span style="color:#ccc;">&laquo;Primero</span>
  90.         &nbsp;&nbsp;
  91.         <span style="color:#ccc;">&lt;Anterior</span>
  92.     <?
  93.     }
  94.     ?>&nbsp;&nbsp;&nbsp;&nbsp;<?
  95.         if ($total_paginas <= $tpg){
  96.             for($i=1; $i<=$total_paginas; $i++){
  97.                     if ($i==$pagina){
  98.                         echo $comj." <span>".$pagina."</span> ";
  99.                     }else{
  100.                      echo $comj;
  101.                     ?> <a style='text-decoration:none;' href="<?=$href1.$i.$href2?>"><?=$i?></a>
  102.                     <?  
  103.                     }
  104.                     $comj="-";
  105.                 }
  106.     }else{
  107.    
  108.         if($pagina <= (round($tpg/2))){
  109.                 for($i=1; $i<=$tpg; $i++){
  110.                     if ($i==$pagina){
  111.                         echo $comj." <span>".$pagina."</span> ";
  112.                     }else{
  113.                      echo $comj;
  114.                     ?> <a style='text-decoration:none;' href="<?=$href1.$i.$href2?>"><?=$i?></a>
  115.                     <?  
  116.                     }
  117.                     $comj="-";
  118.                 }                  
  119.     }elseif($pagina >=($total_paginas-(round($tpg/2))) ){
  120.             $ini=$total_paginas-($tpg-1);
  121.             for($i=$ini; $i<=$total_paginas; $i++){
  122.                     if ($i==$pagina){
  123.                         echo $comj." <span>".$pagina."</span> ";
  124.                     }else{
  125.                      echo $comj;
  126.                     ?> <a style='text-decoration:none; ' href="<?=$href1.$i.$href2?>"><?=$i?></a>
  127.                     <?
  128.                     }
  129.                     $comj="-";
  130.             }
  131.     }else{
  132.        
  133.         for($i=($pagina-$men); $i<=($pagina+$men2); $i++){
  134.        
  135.                 if ($i==$pagina){
  136.                     echo $comj." <span >".$pagina."</span> ";
  137.                 }else{  echo $comj;
  138.                     ?> <a style="text-decoration:none;" href="<?=$href1.$i.$href2?>"><?=$i?></a>
  139.                 <? }           
  140.                 $comj="-";         
  141.         }
  142.     }
  143.     }
  144. ?>&nbsp;&nbsp;&nbsp;&nbsp;<?
  145.     if(($pagina + 1)<= $total_paginas)
  146. { $sig= $pagina + 1;
  147.             ?>
  148.         <a href= "<?=$href1.$sig.$href2?>"  style="text-decoration:none;">Siguiente&gt;</a>&nbsp;&nbsp;
  149.         <a href= "<?=$href1.$total_paginas.$href2?>"   style="text-decoration:none;">Ultimo&raquo;</a>
  150.         <?
  151.        
  152.     }else{
  153.     ?>
  154.     <span style="color:#ccc;">Siguiente&gt;&nbsp;&nbsp;</span>
  155.     <span style="color:#ccc;"> Ultimo&raquo;</span>
  156.     <?
  157.     }
  158.     echo "</div>";
  159. }                      
  160.  ?>         </td>
  161.     </tfoot>
  162.    
  163.    
  164.     <tbody>
  165.     <?
  166.        
  167.         while($bus=mysql_fetch_array($lista)){
  168.         if($num%2){
  169.             $color = "bg1";
  170.         }else{
  171.             $color = "bg2";
  172.         }
  173.         $num++;
  174.      ?>
  175.         <tr class="<?=$color?>">
  176.             <td style="vertical-align:middle;"><div id="item-<?=$bus['id_usuario']?>"  class="checkbox" onclick="check(this.id);"><input name="id[]" id="id-<?=$bus['id_usuario']?>" type="hidden" value="0"></div></td>
  177.             <td><?=$bus['nombre_usuario']?></td>
  178.             <td><?=$bus['login_usuario']?></td>
  179.             <td><?=$bus['email_usuario']?></td>
  180.             <td>&nbsp;<?=ucwords($bus['tipo_usuario'])?></td>
  181.             <td>
  182.                 <select name="jumpMenu1" id="jumpMenu1" class="status" onchange="stat2(this.value, '<?=$bus['id_usuario']?>', '<?=$filtro?>', 'usuarios/listarUsuarios.php')">
  183.                     <option value="0" <? if($bus['status_usuario']==0){?> selected="selected"<? }?>>Publicado</option>
  184.                     <option value="1" <? if($bus['status_usuario']==1){?> selected="selected"<? }?>>Desactivar</option>
  185.                 </select>           </td>
  186.         </tr>
  187.     <? } ?>
  188.     </tbody>
  189. </table>