Comunidad de diseño web y desarrollo en internet online

mx.remoting.RecordSet Necesito ayuda

Citar            
MensajeEscrito el 01 Ago 2006 07:55 am
Hola, necesito filtrar los los resultados de una base de datos muy grande en flash. Tengo éste código de fuente, pero no se porque no me da resultado.

http://www.5etdemi.com/blog/archives/2006/05/using-mxremotingrecordset-advanced-methods/

El .fla está acá:

http://www.5etdemi.com/uploads/movies.fla

y este es el php:


Código :

<?php

class TimelineService{
 
    define('DB_SERVER', 'localhost'); 
    define('DB_SERVER_USERNAME', 'user'); 
    define('DB_SERVER_PASSWORD', 'pass'); 
    define('DB_DATABASE', 'tl_events'); 
   
      function TimelineService(){
   /**
    * @access remote
    */
         $this->methodTable = array(
               "getAllMovies" => array(
               "description" => "No description given.",
               "arguments" => array(),
               "access" => "remote"
               ),
               "getMovie" => array(
               "description" => "No description given.",
               "arguments" => array("id"),
               "access" => "remote"
               )
         );
         
      mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD);
      mysql_select_db(DB_DATABASE);
}
   
   /**
    * @access remote
    */
   function getAllMovies(){
      return mysql_query('SELECT id_event, dateYear, title FROM tl_events WHERE type = 0');
   }
   
   /**
    * @access remote
    */
   function getMovie($id){
      return mysql_query(sprintf('SELECT * FROM tl_events WHERE type = 0 AND id_event = %d, $id'));
   }
}
?>


No soy muy experto en php ni flash, aunque por lo general sí entiendo los códigos y los puedo aplicar bien, pero acá no se porqe no me funciona, si alguien me puede ayudar seria genial.

Gracias,

Tom

Por tatria

6 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 02 Ago 2006 06:19 am
mmm lei esto

Código :

var gatewayUrl:String = "http://flashservices/gateway.php";

deberia ser al menos

Código :

var gatewayUrl:String = "http://localhost/flashservices/gateway.php";


si lo esta probando en local claro, te sugiero leer los tutoriales de remoting que estan disponibles aqui primero

saludos

Por Maikel

BOFH

5575 de clabLevel

22 tutoriales
5 articulos

Genero:Masculino   Team Cristalab

Claber de baja indefinida

firefox
Citar            
MensajeEscrito el 02 Ago 2006 06:21 pm
Hola, mi gatewayUrl está bien. El servicio están en la carpeta , services/timeline/TimelineService.php dentro de flashservices. Me pregunto si tal vez el php está mal, o la method table.


Saludos

Por tatria

6 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 02 Ago 2006 08:51 pm
Hola Denuevo, ya resolvi el problema, era el php, asi quedo al final:

TimelineService.php

Código :


<?php

class TimelineService{
 
       var $dbhost = "localhost";
        var $dbname = "your_table";
        var $dbuser = "user";
        var $dbpass = "password";
   
      function TimelineService(){
   /**
    * @access remote
    */
         $this->methodTable = array(
               "getAllMovies" => array(
               "description" => "No description given.",
               "arguments" => array(),
               "access" => "remote"
               ),
               "getMovie" => array(
               "description" => "No description given.",
               "arguments" => array("id"),
               "access" => "remote"
               )
         );
         
                  $this->conn = mysql_connect($this->dbhost, $this->dbuser, $this->dbpass) or die("");
            mysql_select_db ($this->dbname,$this->conn);
      }
   
      /**
       * @access remote
       */
      function getAllMovies(){
         $query="SELECT id_event, dateYear, title FROM tl_events WHERE type = 0";
         return mysql_query($query,$this->conn);
      }
   
      /**
       * @access remote
       */
      function getMovie($id){
      $query="SELECT * FROM tl_events WHERE type = 0 AND id_event = '".$id."'";
         return mysql_query(sprintf($query,$this->conn));
      }
   }
?>

Por tatria

6 de clabLevel



Genero:Masculino  

msie

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.