[PHP] Problem with a while loop

2004-10-07 Thread Richard Kurth
I am having a problem with a while loop if I put in a number with 0's in front of it it converts the number two the first whole number. such as 1 would be 1 02200 would be 2200. Then it starts the count down starting with that number. How can I make it not remove the 0's in front of the

Re: [PHP] Problem with a while loop

2004-10-07 Thread djoseph
The following script would look like this when run 1 2 3 4 I needed it to look like this 1 2 3 You're going to want to use printf or sprintf to format the numbers. example: printf( %05d, $i ); this would print out your number, then left fill it will the zeros you

Re[2]: [PHP] Problem with a while loop

2004-10-07 Thread Richard Kurth
Hello djoseph, Thursday, October 7, 2004, 11:34:22 AM, you wrote: The following script would look like this when run 1 2 3 4 I needed it to look like this 1 2 3 dtrc You're going to want to use printf or sprintf to format the numbers. dtrc example: printf( %05d, $i );

Re: [PHP] Problem with a while loop

2004-10-07 Thread Janet Valade
Richard Kurth wrote: I am having a problem with a while loop if I put in a number with 0's in front of it it converts the number two the first whole number. such as 1 would be 1 02200 would be 2200. Then it starts the count down starting with that number. How can I make it not remove the 0's

[PHP] problem with a while loop

2004-05-06 Thread Jessica Mays
From: [EMAIL PROTECTED] Subject:problem with a while loop Date: May 6, 2004 11:25:28 AM EDT To: [EMAIL PROTECTED] Hey everybody! I am new to php (and mySQL) and I am working on a php page that links up to a mySQL database. My current code works

Re: [PHP] problem with a while loop

2004-05-06 Thread John Nichel
Jessica Mays wrote: From: [EMAIL PROTECTED] Subject: problem with a while loop Date: May 6, 2004 11:25:28 AM EDT To: [EMAIL PROTECTED] Hey everybody! I am new to php (and mySQL) and I am working on a php page that links up to a mySQL database. My current code

Re: [PHP] problem with a while loop

2004-05-06 Thread John W. Holmes
From: Jessica Mays [EMAIL PROTECTED] I am new to php (and mySQL) and I am working on a php page that links up to a mySQL database. My current code works up to a point, BUT what happens is that I try to have a while loop and check a variable with an inner while loop but it only catches after

Re: [PHP] problem with a while loop

2004-05-06 Thread John W. Holmes
From: John Nichel [EMAIL PROTECTED] $i =0; while ($i $num_results) { $row = mysql_fetch_array($result); $producer = $row[PRODUCE]; snip Try changing the above from while ($i $num_results) { $row = mysql_fetch_array($result); To

Re: [PHP] problem with a while loop

2004-05-06 Thread John Nichel
John W. Holmes wrote: Same thing, really. It's a little more efficient than keeping a count, but not the cause of any of the problems. :) ---John Holmes... Chris! John is picking on me! ;) -- John C. Nichel KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List

Re: [PHP] problem with a while loop

2004-05-06 Thread John W. Holmes
From: John Nichel [EMAIL PROTECTED] Same thing, really. It's a little more efficient than keeping a count, but not the cause of any of the problems. :) ---John Holmes... Chris! John is picking on me! I thought we agreed that Chris is the one that cannot be trusted?? ---John

[PHP] problem with a while loop

2001-10-26 Thread Richard Kurth
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

RE: [PHP] problem with a while loop

2001-10-26 Thread Niklas Lampén
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

Re: [PHP] problem with a while loop

2001-10-26 Thread David Robley
On Fri, 26 Oct 2001 16:40, Richard Kurth wrote: 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

Re: [PHP] problem with a while loop

2001-10-26 Thread Richard Baskett
Or you can do something like: $query = SELECT * FROM members Where Company LIKE '%$search1%'; $result = mysql_db_query($dbName, $query); $numRows = mysql_num_rows($result); for ($i=0; $i$numRows; $i++) { $row = mysql_fetch_array($result); $email[] = $row[email]; } OR while ($row =