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
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
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 );
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
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
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
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
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
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
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
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
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
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
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 =
14 matches
Mail list logo