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;


Showing various result from a mysql query
Juan Stiller <[EMAIL PROTECTED]>
Thu, 29 Sep 2005 20:11:27 +0000 (GMT)

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:


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

This is the php code:

$conn = @mysql_connect("localhost", "blah", "blah23");

if (!$conn) {
echo( "<P>No se pudo conectar " .
"al servidor MySQL.</P>" );

if (! @mysql_select_db("llamadas") ) {
echo( "<P>No se puede encontrar " .
"la base de datos clientes!</P>" );

$qr = mysql_query("select * from datos");
$nrows =
$rString = "n=".$nrows;
for ($i=0; $i < $nrows; $i++) {
$row = mysql_fetch_array($qr);
$rstring .= "&Id".$i."=".$row['id'];
$rString .=
$rString .=
$rString .= "&Receptor".$i."=".$row['receptor'].
$rString .=
$rString .= "&Apellido".$i."=".$row['apellido'].
$rstring .= "&Nombre".$i."=".$row['nombre'];
$rstring .= "&Telefono".$i."=".$row['telefono'];
$rstring .= "&Asunto".$i."=".$row['asunto'];
echo $rString;

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

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

Reply via email to