A quick glance says that's all perfectly right, I would run the query on the mysql 
command line to be sure it's really giving more than 1 result - but I can suggest two 

1) be sure to mysql_free_result($result) afterwards if you're done with the query but 
your script will still be doing anything. You really do want to do that because it 
tells mysql you're done with that so it can release the memory - PHP doesn't actually 
use the memory for that resultset, it just holds a result id that it uses to get the 
results from mysql (so best to let mysql have its memory back as soon as you're done).

2) you will save yourself a fair amount of effort and readability, if you don't need 
those variables other than to print, to change things like so:
echo "&Apellido=$apellido";
--- becomes ---
echo "&Apellido={$row['appellidoclientesnuevos']}";
(you don't need to use ', " works too - I find ' more legible here)

This may also reduce confusion if you start thinking that the database field is 
holding just names, instead of names of new clients (e.g. you accidentally paste it 
elsewhere for use and keep pulling only from the new clients table).

Are you perhaps storing clients in that table temporarily, so it rarely has many 
clients in it?  That could explain the behaviour as well.

- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent those of St. 
Jude Children's Research Hospital.

-----Original Message-----
From: Juan Stiller [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 18, 2004 11:07 AM
Subject: [PHP-DB] Showing all mysql query results!

Hi, im using this script, to show all entrys of a
mysql database on a flash movieclip, but i was told at
flash forums, that this code is not ok, because its
showing only the last entry not all of them, maybe you
someone can recommend what to add to this little

$conn = @mysql_connect("***", "***", "****");

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

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

// Request all data
$result1 = mysql_query("select * from

print "Results=";
echo "<h1>Clientes agregados:</h1><br>";

while($row=mysql_fetch_array($result1, MYSQL_ASSOC))
echo "&Id=$id";
echo "&Apellido=$apellido";

echo "&Nombre=$nombre";

echo "&Dni=$dni";

echo "&Telefono=$telefono";

echo "&Dia=$dia";

echo "&Mes=$mes";

echo "&Ano=$ano";

echo "&Hora=$hora";

echo "&Minutos=$minutos";

echo "&Abogado=$abogado";

echo "&Asunto=$asunto";

echo "&Donde=$donde";



¡Llevate a Yahoo! en tu Unifón! 
Ahora podés usar Yahoo! Messenger en tu Unifón, en cualquier momento y lugar. 
Encontrá más información en: http://ar.mobile.yahoo.com/sms.html 

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

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

Reply via email to