Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.


Results 1 to 5 of 5

Thread: Tutorial Search: mySQL Filtering

  1. #1

    Tutorial Search: mySQL Filtering

    Hi Kirupans,

    Happy New Year to everyone. I'm trying to look for a tutorial that will allow me to filter my entire product catalog in a mySQL database. All of the products are already there and my database has been structured, but I'm looking for a way to have a page that spits out ALL of the products at once, then build in a form that lets my users select the features they're looking for, and narrow down their selection (live using AJAX if possible, but not necessary).

    If you know of a tutorial or a set of tutorials that would come in handy, or would like to lend me some guidance, let me know! Much obliged!

  2. #2

  3. #3
    Hey Brian,

    Thanks for the link. I think I've got a good grip on how to write the SQL queries (again, I think), but what I'm really looking for is information on how to write the PHP/Javascript to modify the SQL query as the user makes their selections.

  4. #4

  5. #5
    I'm just going to post some conceptual stuff, no code. An easy way to do what you want is to have a template query, something like "SELECT * FROM $table SORT BY $sortMethod $direction"

    And then you have drop downs or whatever that would set the $table variable, the $sortMethod (i.e. date, id, etc) and then something to selecect ascending or descending.

    Not sure if this is what you're looking for or not, but you can load up your query with variables, so all you need to figure out is how to get the variables you want to where you want them.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012