Jump to content

onefitchick

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

onefitchick's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thought this was interesting even though I haven't solved the problem...when I click on page 1, the last page is numbered 35 (a reasonable guess at how many pages my search term would output)… and when I click on page 2 or 3, the last page is numbered 98…(which is my entire database). Using View Source: Page 1 class="pagination_links"> First <<<span> 1 </span> <span><a href="/searchgym.php?page=2&param1=valu1&param2=value2">2</a></span> <span><a href="/searchgym.php?page=3&param1=valu1&param2=value2">3</a></span> <span><a href="/searchgym.php?page=4&param1=valu1&param2=value2">4</a></span> <a href="/searchgym.php?page=2&param1=valu1&param2=value2">>></a> <a href="/searchgym.php?page=35&param1=valu1&param2=value2">Last</a> </div> Page 3 class="pagination_links"> <a href="/searchgym.php?page=1&param1=valu1&param2=value2">First</a> <a href="/searchgym.php?page=2&param1=valu1&param2=value2"><<</a> <span><a href="/searchgym.php?page=1&param1=valu1&param2=value2">1</a></span> <span><a href="/searchgym.php?page=2&param1=valu1&param2=value2">2</a></span> <span> 3 </span> <span><a href="/searchgym.php?page=4&param1=valu1&param2=value2">4</a></span> <a href="/searchgym.php?page=4&param1=valu1&param2=value2">>></a> <a href="/searchgym.php?page=98&param1=valu1&param2=value2">Last</a> </div>
  2. Thanks for the help, but sadly none of these worked. There shouldn't be any syntax problems in the ps_pagination file because that's a download you can take off the internet. I'll keep working on it.
  3. I tried deleting the var $sql = ""; line, but it didn't work. Thank you Rizla. JAY6390 (or Rizla), how would I check for this: "It looks more likely that the page number isn't being passed to/from the class, causing this issue, or it's not being inserted into the query. "
  4. I didn't write it . I paid someone to do it.
  5. I'm attaching the index file where the search box is located, and searchgym where page 2 does not include the search term, and also ps_pagination file. I think this is all that's involved? Thank you so much! [attachment deleted by admin]
  6. I'm not sure. I don't really know anything about php. I will try to understand what you wrote. Thanks for the reply.
  7. Hi everyone, I'm having a problem where if I type a word into my search box, what comes up on the first result page is correct, but then when I click to the second result page, it returns everything that's in my database, and not just the search term anymore. I'm guessing there is some problem where the search term gets wiped out after the first page. index.php includes the search box, and searchgym.php is where the results should be and the page navigation. I would appreciate any help at all as I've been trying to figure this out for days (I'm new to php/mysql and didn't code this myself...). To see an example online, go to http://www.RateMyFitnessInstructor.com, click on the "find a gym" tab, and type in "world gym". The first page should have all "world gym", but page 2 and beyond have every gym in the database. Thanks!
  8. Thanks for the help but still can't figure it out. This is what I did, but now when I go to my site, it says there are no countries, states, cities, gyms that match anything. if(isset($countryid)) { $sql = "Select * from ".TBGYM." G LEFT JOIN ".TBCITIES." CT ON G.cityid= CT.id LEFT JOIN ".TBSTATES." S ON CT.sid=S.id LEFT JOIN ".TBCOUNTRY." C ON S.cid=C.countries_id WHERE G.countryid= .$countryid ORDER BY name, cityname, gymname"; } if(isset($stateid)) { $sql = "Select * from ".TBGYM." G LEFT JOIN ".TBCITIES." CT ON G.cityid= CT.id LEFT JOIN ".TBSTATES." S ON CT.sid=S.id LEFT JOIN ".TBCOUNTRY." C ON S.cid=C.countries_id WHERE G.stateid= .$stateid ORDER BY name, cityname, gymname"; } if(isset($cityid)) { $sql = "Select * from ".TBGYM." G LEFT JOIN ".TBCITIES." CT ON G.cityid= CT.id LEFT JOIN ".TBSTATES." S ON CT.sid=S.id LEFT JOIN ".TBCOUNTRY." C ON S.cid=C.countries_id WHERE G.cityid= .$cityid ORDER BY name, cityname, gymname"; }
  9. Hello. I would like to order by ascending States, then Cities, then Gyms in the following code, but I can't figure it out. If anyone could help, I would truly appreciated it! if(isset($countryid)) { $sql = "Select * from ".TBGYM." G LEFT JOIN ".TBCITIES." CT ON G.cityid= CT.id LEFT JOIN ".TBSTATES." S ON CT.sid=S.id LEFT JOIN ".TBCOUNTRY." C ON S.cid=C.countries_id WHERE G.countryid=".$countryid; } if(isset($stateid)) { $sql = "Select * from ".TBGYM." G LEFT JOIN ".TBCITIES." CT ON G.cityid= CT.id LEFT JOIN ".TBSTATES." S ON CT.sid=S.id LEFT JOIN ".TBCOUNTRY." C ON S.cid=C.countries_id WHERE G.stateid=".$stateid; } if(isset($cityid)) { $sql = "Select * from ".TBGYM." G LEFT JOIN ".TBCITIES." CT ON G.cityid= CT.id LEFT JOIN ".TBSTATES." S ON CT.sid=S.id LEFT JOIN ".TBCOUNTRY." C ON S.cid=C.countries_id WHERE G.cityid=".$cityid; } $pager = new PS_Pagination($db, $sql, $noofrecords,$noofnavigators, "param1=valu1&param2=value2"); $pager->setDebug(true); $rs = $pager->paginate(); if(!$rs) die(mysql_error()); while($row = mysql_fetch_assoc($rs)) { $arr_result [] = $row; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.