SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 32 of 32
  1. #26
    SitePoint Zealot 容d席m L鷦i's Avatar
    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

  2. #27
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    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>,
    Because this is what you want, you think the code "works".
    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:

  3. #28
    SitePoint Zealot 容d席m L鷦i's Avatar
    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

  4. #29
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    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?

  5. #30
    SitePoint Zealot 容d席m L鷦i's Avatar
    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

  6. #31
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    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 
    ", ";

    Try changing it to this
    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 
    ", ";

    Or, after setting $min's value to the number 0, change the conditional to
    PHP Code:
    if($startat === $min
    Last edited by Mittineague; Sep 9, 2005 at 06:05. Reason: :doh:

  7. #32
    SitePoint Zealot 容d席m L鷦i's Avatar
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •