Jump to content
Larry Ullman's Book Forums


  • Posts

  • Joined

  • Last visited

Beltic's Achievements


Newbie (1/14)



  1. I figured out what it was. I wasnt appending variables for my query to the sort URL. I had this, http://medieval.name/browse_search_results.php?sort=te Instead I needed this, http://medieval.name/browse_search_results.php?term=saxon&sort=te Then it worked fine.
  2. Following the book I have successfully used pagination. It looks great! Now however, Im getting to the point where I have multiple rows of page numbers. What could I start to look at so instead of this, < 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39> I could get this, < 1... 8 9 10 11 12 13 ...39 > Thanks!
  3. Hi Larry! Im sorry I wasnt clear. What I mean is, a user can perorm a search using a text box and three drop down lists. For example it could be a seach on Britain in the Dark Ages returning 25 results. When one of the sort buttons is clickled however, the page is not sorted by the results of Britain in the Dark Ages that returned 25 results. It returns and sorts all of the data in the database, each row, of 725+ results, and is not limiting itself to the user query. Thanks!
  4. First I just want to thank Larry for explaining PHP in a method I could understand. From reading his book in three days I went from a barely functioning site with security holes to a improved, stable site. If your interested in seeing it, its here, http://medieval.name I did have one issue, that is with using a sort feature. I use the template from Chapter 10. Setting the sort variable, setting up the switch, adding $order_by to the query, adding sort to the pagination. The sort works, but it sorts all data, not limiting itself to the data from the query. Im sure Im missing something obvious. The following is the only editing I did, // Default is by registration date. $sort = (isset($_GET['sort'])) ? $_GET['sort'] : 'te'; // Determine the sorting order: switch ($sort) { case 'te': $order_by = 'term ASC'; break; case 'ct': $order_by = 'category ASC'; break; case 'pl': $order_by = 'place ASC'; break; default: $order_by = 'term ASC'; $sort = 'te'; break; } echo ' <a href="search_results.php?sort=te">Term</a> <a href="search_results.php?sort=ct">Category</a> <a href="search_results.php?sort=pl">place</a> '; Suggestions are welcome.
  • Create New...