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 :) Now that I
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 now
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 2002
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
}
.
-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
}
Rick
The vision must
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 suggestions
], [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
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
}
[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, I've tried looking in the
manual, but I
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 the
out $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
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!
Now... I have this little problem:
if ($num_pages = 2) {
for ($i=1; $i
, 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 apologizing right now for this, but I hope it's at least
tolerable. I have
-
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) {
echo $i
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 = 2) {
for ($i=1; $i=$num_pages; $i+=20) {
echo $i;
}
}
I get 1, or whatever I set $i
-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 to get the
first 20 records from 1, then Page 2 = LIMIT 21,20 to get the next 20, etc.
I think I see the error here
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 alone
I think I see the error here.
if ($num_pages = 2) {
for ($i=1; $i=$num_pages; $i++) {
$number = ($i * 20) + 1;
printf(| a
href=\test.php?page=%s\Page %s/a | , $number,
$i);
to jet. I'll
be thinkin' on this one while DJing, definitely!
Thanks again for everyone's help.
-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 8:30 PM
To: Jason Soza; PHP General
Subject: Re: [PHP] Feelin' dumb...
That means
19 matches
Mail list logo