SitePoint Sponsor |
|
User Tag List
Results 26 to 32 of 32
Thread: $limit issues...
-
Sep 8, 2005, 22:40 #26
- Join Date
- Jan 2005
- Location
- Washington
- Posts
- 114
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
great another one ****ing gives up....can't anyone goddamn help me????
"'I earned political capital during this campaign and
now I intend to spend it'-George Bush
translation: if you thought i was a reckless moron
these last four years, you aint seen nothing yet"-Lakai.com
-
Sep 8, 2005, 23:13 #27
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
I did not "give up". Because you did not post the code, I had to go through the inconvenience of starting up a browser, and then manuever to the page to see this. (newlines mine)
HTML Code:Page: <b>1</b>, <a href=?action=editlocationlog&id=5&min=30>2</a>, <a href=?action=editlocationlog&id=5&min=60>3</a>, <a href=?action=editlocationlog&id=5&min=90>4</a>, <a href=?action=editlocationlog&id=5&min=120>5</a>, <a href=?action=editlocationlog&id=5&min=150>6</a>, <a href=?action=editlocationlog&id=5&min=180>7</a>, <a href=?action=editlocationlog&id=5&min=210>8</a>, <a href=?action=editlocationlog&id=5&min=240>9</a>, <a href=?action=editlocationlog&id=5&min=270>10</a>, <a href=?action=editlocationlog&id=5&min=300>11</a>, <a href=?action=editlocationlog&id=5&min=330>12</a>, <a href=?action=editlocationlog&id=5&min=360>13</a>, <a href=?action=editlocationlog&id=5&min=390>14</a>, <a href=?action=editlocationlog&id=5&min=420>15</a>,
But look at the math
for ($x=1;$x<=$pages;$x++)
//sets value of $x to 1 for the first pass through loop
$startat = (($x-1) * 30);
//$startat is equal to 0 times 30
if($startat == $min)
// 0 is "equal to" undefined (or empty) - both considered "false"
You need to set the value of $min
(as stated in post #8 over 2 hours ago by markl999)Last edited by Mittineague; Sep 9, 2005 at 05:52. Reason: :doh:
Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Sep 8, 2005, 23:14 #28
- Join Date
- Jan 2005
- Location
- Washington
- Posts
- 114
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
oh thank god i thought you left me... so what would i set $min = to??
by the way sorry for the inconvience i jsut didn't understand what code you were asking for..."'I earned political capital during this campaign and
now I intend to spend it'-George Bush
translation: if you thought i was a reckless moron
these last four years, you aint seen nothing yet"-Lakai.com
-
Sep 8, 2005, 23:21 #29
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
That depends. What does it represent, anything? Is it just a variable used for operations? I see that it increments by 30 each page, is that significant or just arbitrary?
Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Sep 8, 2005, 23:22 #30
- Join Date
- Jan 2005
- Location
- Washington
- Posts
- 114
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
no idea... someone jsut showed me this script and i am trying to run with it... i don't think it matters
"'I earned political capital during this campaign and
now I intend to spend it'-George Bush
translation: if you thought i was a reckless moron
these last four years, you aint seen nothing yet"-Lakai.com
-
Sep 9, 2005, 00:05 #31
- Join Date
- Jul 2005
- Location
- West Springfield, Massachusetts
- Posts
- 17,290
- Mentioned
- 198 Post(s)
- Tagged
- 3 Thread(s)
I'm guessing that "min" is short for "minimum". (as in results per page) If so, I think 0 would be an appropriate value. Simply setting $min = 0; will work for the data base query, but the loop code will have to be changed since the conditional is faulty.
Currently it's like this
PHP Code:for ($x=1;$x<=$pages;$x++)
{
$startat = (($x-1) * 30);
if($startat == $min)
{
echo "<b>$x</b>";
}
if($startat != $min)
{
echo "<a href=?action=editlocationlog&id=$id&min=$startat>$x</a>";
}
echo ", ";
}
PHP Code:for ($x=1;$x<=$pages;$x++){
if($x==1){
$startat = 0;
echo "<b>$x</b>";
} else {
$startat = (($x-1) * 30);
echo "<a href=?action=editlocationlog&id=$id&min=$startat>$x</a>";
}
echo ", ";
}
PHP Code:if($startat === $min)
Last edited by Mittineague; Sep 9, 2005 at 06:05. Reason: :doh:
Big Change Coming Soon - if you want your PMs save them now!
What you need to do to prepare for our migration to Discourse
A New SitePoint Forum Experience: Our Move to Discourse
-
Sep 9, 2005, 10:36 #32
- Join Date
- Jan 2005
- Location
- Washington
- Posts
- 114
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
works like a charm.... Thank you so much for putting up with my stupidness and frustration... and sticking in there to help me out...
"'I earned political capital during this campaign and
now I intend to spend it'-George Bush
translation: if you thought i was a reckless moron
these last four years, you aint seen nothing yet"-Lakai.com
Bookmarks