Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/07/2011, 05:13
Avatar de Eleazan
Eleazan
 
Fecha de Ingreso: abril-2008
Ubicación: Ibiza
Mensajes: 1.879
Antigüedad: 16 años
Puntos: 326
Respuesta: Optimizar estas sentencias PHP/SQL?

Sentencia B
Código:
SELECT * FROM NOTICIAS ORDER BY `id` DESC LIMIT 5
? No te vale así? xD

Sentencia C
Código PHP:
if(isset($_GET['go'])) { 
      
$go struppercase($_GET['go']);
      if(
go != "TODO" $filtering " WHERE `tipo`='".$go."' AND `validated`=1";

      if(!
$_GET[pag]){ 
        
$paging "0";

        } else {
         
        
$suk $_GET[pag]*24-24;
        
$paging $suk;
        }

        
$kik mysql_query("SELECT * from noticias $filtering order by id desc limit $paging,24");
             
//contamos cuantos resultados hay
             
$kiktotalmysql_num_rows($kik);
        
        
$is 0
Esta tendría dos problemas: "PELICULAS" y "SERIES" no las encontraría (pues buscaria tipo PELICULAS cuando es PELICULA...). Y deberías tratar el GET antes de recibirlo :)