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 in
> 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 zero
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 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 (http://ww
From: "John Nichel" <[EMAIL PROTECTED]>
> > $i =0;
> >
> > while ($i < $num_results) {
> >
> > $row = mysql_fetch_array($result);
> >
> > $producer = $row["PRODUCE"];
>
>
> Try changing the above from
>
> while ($i < $num_results) {
>
> $row = mysql_fetch_arr
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
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 w
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 = mysql
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
>
>
your while loop is working fine -- it's just that you're re-setting the value
of $email every time it loops through.
I'm not sure what you're trying to accomplish, but you might try something
like:
$query = "SELECT * FROM members Where Company LIKE '%$search1%'";
$result=mysql_db_query($dbNam
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:[EMAIL PROTECTED]]
Sent: 26. lokakuuta 2
11 matches
Mail list logo