Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/06/2017, 13:48
xoceunder
 
Fecha de Ingreso: junio-2012
Ubicación: En el Mundo
Mensajes: 759
Antigüedad: 11 años, 11 meses
Puntos: 10
duda de usar memcached en php

Hola a todos es que quiero ver como puedo hacer esto posible tengo esto echo

Código PHP:
Ver original
  1. <?php
  2. require_once('config.php');
  3. header('Content-type: application/json');
  4.  
  5. $tipo = mysql_real_escape_string($_GET['tipo']);
  6.  
  7. $q_con = mysql_query("SELECT * FROM cat_categorias WHERE cve_cat_tipo_contenido='".$tipo."' ORDER BY orden ASC");
  8.  
  9. $jsonArray = array();
  10.  
  11. while ($res = mysql_fetch_array($q_con)) {
  12.  
  13.     $temp = array("cve"=>$res['cve'],
  14.         "Category" => htmlspecialchars(html_entity_decode(utf8_encode($res['categoria'])))
  15.     );
  16.        
  17. $sql = mysql_query("SELECT
  18.         co.cve,
  19.         co.titulo,
  20.         co.titulo_latino,
  21.         co.poster,
  22.         co.fondo,
  23.         co.anio,
  24.         co.clasificacion,
  25.         co.duracion,
  26.         co.director,
  27.         co.reparto,
  28.         co.cve_cat_categoria,
  29.         co.cve_cat_audio,
  30.         co.pedir_pin,
  31.         co.cve_cat_tipo_contenido as tipo,
  32.         cc.calidad,
  33.         cau.audio,
  34.        cfv.formato_video,
  35.        uv.url_video
  36.     FROM
  37.         contenido co,
  38.         cat_calidad cc,
  39.         cat_audio cau,
  40.        cat_formato_video cfv,
  41.        url_video uv
  42.     WHERE
  43.        FIND_IN_SET( '".$res["cve"]."', co.cve_cat_categoria )
  44.         AND cfv.cve=uv.cve_cat_formato_video
  45.        AND uv.cve_cat_tipo_contenido=co.cve_cat_tipo_contenido
  46.        AND uv.cve_contenido=co.cve
  47.         AND cc.cve=co.cve_cat_calidad
  48.         AND cau.cve=co.cve_cat_audio
  49.         ORDER BY co.cve ASC");
  50.  
  51.   while($res = mysql_fetch_array($sql)){
  52.      
  53. $sub = mysql_fetch_array( mysql_query("SELECT subtitulo FROM subtitulos WHERE cve_contenido='".$res['cve']."' AND cve_cat_tipo_contenido='".$res['tipo']."'") );
  54.  
  55. $description = mysql_fetch_array(mysql_query("SELECT * FROM sinopsis WHERE cve_contenido='".$res['cve']."' AND cve_cat_tipo_contenido='".$res['tipo']."'"));
  56.  
  57. $audio = mysql_fetch_array(mysql_query("SELECT audio FROM cat_audio WHERE cve='".$res['cve_cat_audio']."'"));
  58.  
  59. if (empty($res['poster'])) {
  60.     # code...
  61.     $poster = "no-poster.png";
  62. }else{
  63.     $poster = $res['poster'];
  64. }
  65.  
  66.     $temp["items"][] = array(
  67.    
  68.             "MoviesId" =>$res['cve'],
  69.             "Title" => htmlspecialchars(html_entity_decode(utf8_encode($res['titulo']))),
  70.             "ContentType" =>"movie",
  71.             "Description"=>htmlspecialchars(html_entity_decode(utf8_encode($description['sinopsis']))),
  72.             "ReleaseDate" =>$res['anio'],
  73.             "Rating" =>$res['clasificacion'],
  74.             "StarRating" =>"80",
  75.             "Actors" =>htmlspecialchars(html_entity_decode(utf8_encode($res['director']))),
  76.             "Directors" =>htmlspecialchars(html_entity_decode(utf8_encode($res['reparto']))),
  77.             "Length" =>$res['duracion'],
  78.             "StreamUrls" =>$res['url_video'],
  79.             "StreamFormat" =>strtolower($res['formato_video']),
  80.             "HDPosterURL" => $poster,
  81.             "hdbackgroundimageurl" => (empty($res['fondo']) ? $poster : $res['fondo']),
  82.             "Pin" => $res['pedir_pin'],
  83.             "SubtitleUrl" =>$sub['subtitulo']
  84.     );
  85.  
  86.   }
  87.  
  88.   $jsonArray[] = $temp;
  89. }
  90.  
  91.  
  92. // echoing JSON response
  93. echo json_encode($jsonArray);
  94.  
  95. ?>

como puedo hacer que trabaje con memcached