--Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 8:47 PM
To: Jason Soza; PHP General
Subject: Re: [PHP] Feelin' dumb...
Ok Im feeling dumb also now *hehe* What I said about putting the $number
line below the printf line.. Don¹t listen to me
is case, it returns 21, so the next iteration is 41. Follow me? I need
> 1, 21, not 21, 41. Almost there I think, unfortunately, I need to jet. I'll
> be thinkin' on this one while DJing, definitely!
>
> Thanks again for everyone's help.
>
> -Original Messa
> I think I see the error here.
>
> if ($num_pages >= 2) {
> for ($i=1; $i<=$num_pages; $i++) {
> $number = ($i * 20) + 1;
> printf("| href=\"test.php?page=%s\">Page %s | ", $number,
> $i);
>
> I think I figured this out -
>
> Since I only have 2 pages, the first iteration of the loop sets $i greater
> than than the number of pages, i.e. $i becomes 21, which is
> greater than 2,
> so the second iteration stops there. Am I seeing this right?
>
> So Craig's way worked because $i was left
TECTED]>
> Date: Fri, 17 May 2002 20:44:30 -0800
> To: "Richard Baskett" <[EMAIL PROTECTED]>, "PHP General"
> <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Feelin' dumb...
>
> The 20 is inserted into a MySQL LIMIT query. Page 1 = LIMIT 1,20 t
Friday, May 17, 2002 8:30 PM
To: Jason Soza; PHP General
Subject: Re: [PHP] Feelin' dumb...
That means $num_pages is equal to 2 so yes the if statement is true and it
goes onto the the for loop. Now where you are having problems is on the
second expression in the for loop.. This expression i
past be the WORST of your future" - Unknown
> From: "Jason Soza" <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 20:23:53 -0800
> To: <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Feelin' dumb...
>
> When I use that, here:
>
> if ($num_pages >=
al Message-
From: Jason Soza [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 8:24 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Feelin' dumb...
When I use that, here:
if ($num_pages >= 2) {
for ($i=1; $i<=$num_pages; $i+=20) {
-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 7:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Feelin' dumb...
Hi
What you need is
for ($i=1; $i<=$num_pages; $i+=20) {
// print stuff here
}
Tom
At 01:19 PM 18/05/2002, Jason Soza wrote:
>Okay, I'm
streetsweeper who did his job
well." - Dr. Martin Luther King, Jr.
> From: "Jason Soza" <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 20:09:55 -0800
> To: <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Feelin' dumb...
>
> Makes sense. Thanks!
>
ut $page = and put in $i where $page is
in the printf() statement, I get the extra iteration again. Any ideas?
-Original Message-
From: Craig Vincent [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 7:56 PM
To: Jason Soza; [EMAIL PROTECTED]
Subject: RE: [PHP] Feelin' dumb...
> I wonder why the other suggestions weren't working. They seemed logical
> enough, I even tried variations of your suggestion, first I tried:
>
> for ($i=1; $i<=$num_pages; $number = $i + 20) {}
> for ($i=1; $i<=$num_pages;) { $number = $i + 20; }
The problem with these two statements was that t
-
From: Craig Vincent [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 7:36 PM
To: Jason Soza; [EMAIL PROTECTED]
Subject: RE: [PHP] Feelin' dumb...
> For each loop, I want to add 20 to $i, so after the first
> iteration, I have
> 21, then 41, 61, etc. I've tried $i+20, $i + 20,
Hi
What you need is
for ($i=1; $i<=$num_pages; $i+=20) {
// print stuff here
}
Tom
At 01:19 PM 18/05/2002, Jason Soza wrote:
>Okay, I'm apologizing right now for this, but I hope it's at least
>tolerable. I have this:
>
>for ($i=1; $i<=$num_pages; $i++) {
> // print stuff here
>
3:25 -0400
> To: Richard Baskett <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: Re: [PHP] Feelin' dumb...
>
> for ($i=1; $i<=$num_pages; $i+20) {
>> // print stuff here
>> }
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> For each loop, I want to add 20 to $i, so after the first
> iteration, I have
> 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
> manual, but I assume this is some C-type function, and I'm not
> familiar with
> C!
Well this is a bit of a detour from the other suggesti
.. Then it times out.
-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 7:15 PM
To: Jason Soza; PHP General
Subject: Re: [PHP] Feelin' dumb...
Hmm... Wouldn¹t you just do this?:
for ($i=1; $i<=$num_pages; $i+20) {
// print stuff here
would that work?
isn't $i++; abbr. for $i = $i + 1;
so now the $i + 20; doens't declare anything.
just like $i += $b; is abbr. $i = $i + $b;
Jule.
On Friday 17 May 2002 23:14, you wrote:
> Hmm... Wouldn¹t you just do this?:
>
> for ($i=1; $i<=$num_pages; $i+20) {
> // print stuff here
> }
Hmm... Wouldn¹t you just do this?:
for ($i=1; $i<=$num_pages; $i+20) {
// print stuff here
}
Rick
"The vision must be followed by the venture. It is not enough to stare up
the steps - we must step up the stairs." - Vance Havner
> From: "Jason Soza" <[EMAIL PROTECTED]>
> Date: Fri, 17 May 200
try,
for ($i=1; $i<=$num_pages; $i = $i + 20) {
}
or try,
$i = 1;
while ($i<=$num_pages) {
//text here
$i = $i + 20;
}
I got those little problems too all the time..
and the boards/lists always help.
Jule
On Friday 17 May 2002 23:19, you wrote:
> Okay, I'm apologizing right n
20 matches
Mail list logo