Re: Re: Showing various result from a mysql query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Juan,

Micah is correct.  You must try it in the Flash environment.

As I was lazy and didn't want to check all your php, I created a simple test file from your mail:

<?php Header("Content-type: application/x-www-urlform-encoded");?>
n=1&Hora0=17:30:43&Apellido0=garofalo&Id0=6&Dia0=28&Mes0=9&Ano0=2005&Nombre0=cristian&Destinatario0=martan=1&Hora0=17:30:43&Apellido0=garofalo&Id0=6&Dia0=28&Mes0=9&Ano0=2005&Nombre0=cristian&Receptor0=marilun=1&Hora0=17:30:43&Apellido0=garofalo&Id0=6&Dia0=28&Mes0=9&Ano0=2005&Nombre0=cristian&Destinatario0=martan=1&Hora0=17:30:43&Apellido0=garofalo&Id0=6&Dia0=28&Mes0=9&Ano0=2005&Nombre0=cristian

Flash read it & seemed to parse the variables just fine. That indicates that your php output is well-formed from the Flash point of view - well in the example given anyway! ;)

If, after adding the header, you still have problems reading in the data in the example then the problem is more likely in the actionscript.

hth,
anna


---------------------------------------------------------------------------
Micah Stevens wrote:

Yes, that sounds correct, when flash requests the page directly, it will
realize it's URLEncoded (or should) and read the variables correctly.

Your browser on the other hand isn't built to display this information, so it
wants you to tell it where to save it.

-Micah

On Tuesday 04 October 2005 9:43 am, Juan Stiller wrote:
> Hi anna,
>
> Thanks for the suggestion, but it didn't worked, when
> i try it on the browser, it ask me if i want to
> download , open the file.
>
> Any other sugg........?
>
>  --- annA <escape2ocean@xxxxxxxxx> escribi�:
> > Hi Juan,
> >
> > I haven't read the list for a 'few' days so I'm
> > sorry if you've been
> > sweating over this, but if you haven't yet solved it
> > then make sure you
> > send a
> >
> > Header("Content-type:
> > application/x-www-urlform-encoded");
> >
> > before your
> >
> > echo $rString;
> >
> > annA
>
> ---------------------------------------------------------------------------
>-
>
> > Subject:
> > Showing various result from a mysql query
> > From:
> > Juan Stiller <juanstiller@xxxxxxxxxxxx>
> > Date:
> > Thu, 29 Sep 2005 20:11:27 +0000 (GMT)
> > To:
> > php-db@xxxxxxxxxxxxx
> >
> > Hi, im working on a php file that its supposed to
> > retrieve data from a mysql database, to send it to a
> > flash animation to show the results. Thing is that
> > im
> > testing some modifications to the code, so if there
> > is
> > more than one entry, it shows all the results.
> >
> > For some reason probably a mistake on the code im
> > getting this output when i try the muestra.php file
> > on
> > the browser:
>
> n=1&Hora0=17:30:43&Apellido0=garofalo&Id0=6&Dia0=28&Mes0=9&Ano0=2005&Nombre
>0=cristian&Destinatario0=martan=1&Hora0=17:30:43&Apellido0=garofalo&Id0=6&Di
>a0=28&Mes0=9&Ano0=2005&Nombre0=cristian&Receptor0=marilun=1&Hora0=17:30:43&A
>pellido0=garofalo&Id0=6&Dia0=28&Mes0=9&Ano0=2005&Nombre0=cristian&Destinatar
>io0=martan=1&Hora0=17:30:43&Apellido0=garofalo&Id0=6&Dia0=28&Mes0=9&Ano0=200
>5&Nombre0=cristian
>
> > This might not be wrong, but when i show info on the
> > flash animation i get eg:
> >
> > Apellido0=garofalo , i dont want to get the n=x on
> > the
> > output, its supposed to be just an internal thing to
> > tell flash that for the variable Apellido(lastname)
> > there is more than one result and then to show all
> > of
> > them.
> >
> >
> > This is the php code:
> >
> > <?php
> > $conn = @mysql_connect("localhost", "blah",
> > "blah23");
> >
> > if (!$conn) {
> > echo( "<P>No se pudo conectar " .
> > "al servidor MySQL.</P>" );
> > exit();
> > }
> >
> > if (! @mysql_select_db("llamadas") ) {
> > echo( "<P>No se puede encontrar " .
> > "la base de datos clientes!</P>" );
> > exit();
> > }
> >
> > $qr = mysql_query("select * from datos");
> > $nrows =
> > mysql_num_rows($qr);
> > $rString = "n=".$nrows;
> > for ($i=0; $i < $nrows; $i++) {
> > $row = mysql_fetch_array($qr);
> > $rstring .= "&Id".$i."=".$row['id'];
> > $rString .=
>
> "&Dia".$i."=".$row['dia']."&Mes".$i."=".$row['mes']."&Ano".$i."=".$row['ano
>'];
>
> > $rString .=
>
> "&Hora".$i."=".$row['hora']."&Minutos".$i."=".$row['minutos'];
>
> > $rString .= "&Receptor".$i."=".$row['receptor'].
> > $rString .=
> > "&Destinatario".$i."=".$row['destinatario'].
> > $rString .= "&Apellido".$i."=".$row['apellido'].
> > $rstring .= "&Nombre".$i."=".$row['nombre'];
> > $rstring .= "&Telefono".$i."=".$row['telefono'];
> > $rstring .= "&Asunto".$i."=".$row['asunto'];
> > }
> > echo $rString;
> > mysql_free_result($qr);
> > ?>
> >
> > Also, i was told that including password and user to
> > connect to mysql server sholdn´t be shown on the php
> > file, so i have to use include_one and the file, but
> > i
> > don´t know exaclty the syntax, can anybody help me
> > with it?
> >
> > Thanks in advance.
>
> ___________________________________________________________
> 1GB gratis, Antivirus y Antispam
> Correo Yahoo!, el mejor correo web del mundo
> http://correo.yahoo.com.ar

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux