turpentyne Posted September 10, 2010 Share Posted September 10, 2010 I'm trying to figure out something that's quite a bit beyond my meager knowledge of PHP, and not sure exactly what's the best way. Kind of confused and lost in the woods without a map. I have a paginated PHP results page that builds its query based on $_GET variables from a previous search page. Then I'm putting down one side of the page, a form full of options to refine the search results. What I want to happen is, when somebody selects something on the "refine search" form, it autosubmits and adds that variable to the URL as "&variable="chosenItem" - but also to say in which table to search for that variable. Then I want the page to reload, change the PHP query to include the tables to join and search variables. Holy cow this is alot to figure out in my head! I've gotten as far as turning most of the query into variables, but not sure if there's a more sensible way to do this or what. Something like this: $select = 'Select Maintable.*, table2.*, table4.*' //this would change based on which tables were in the url $_GET $from = 'from Maintable.field1' $on = 'on table1.id=table.2' $where = 'WHERE x=x AND y=y AND z=z //this also would change based on the url $_GET //then $query = ($SELECT $FROM $WHERE) Beyond this, I have no idea how to get the variables into the url to begin with, nor if this will work. Maybe I'm trying too hard. Maybe there's some simple ways to do this that somebody can explain. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.