RE: [PHP] problem with a while loop
| From: | Niklas Lampén | Date: | Fri, 26 Oct 2001 07:40:45 +0000 |
| Subject: | RE: [PHP] problem with a while loop | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72406@lists.php.net to get a copy of this message | ||
What happens there is this:
$email = "1. row";
$email = "2. row";
$email = "3. row";
echo $email;
You really need to put echo $email inside the loop or use '.=' to set up
values to $email.
Niklas
-----Original Message-----
From: Richard Kurth [mailto:rkurth@starband.net]
Sent: 26. lokakuuta 2001 10:11
To: php
Subject: [PHP] problem with a while loop
I am trying to get the data out of the while loop if I echo $email
inside the } it gives me all of the data but if I echo it out side of
the loop it only gives me one record even though I know there is more.
How can I get this to work
$query = "SELECT * FROM members Where Company LIKE '%$search1%'";
$result=mysql_db_query($dbName,$query);
while ($row = mysql_fetch_array($result)) {
$email= $row["lname"] . " " . "<" . $row["E_mail_1"]
. ">" . ";";
}
echo $email;
--
Best regards,
Richard mailto:rkurth@starband.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net To
contact the list administrators, e-mail: php-list-admin@lists.php.net