Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004

    Unanswered: PHP/MySQL query question

    Hello everyone!

    I'm developing a php/mysql driven product catalog and I encountered a problem with some queries.

    Here is how my structure looks like:

    Family -> SubFamily -> Groups -> Products

    I made a single file which handles all this, so I've done it with Posting the variables from the links to the same page in the URL. This way when I click on a family my subfamily changes, but not my group list (this changes only if I click on a subfamily so the group gets it's variable).

    I have set the default $GET value for each query so when the page loads it shows 1 product from Family id1, subfamily id1, group id1.

    My question is, how can I make a condition or maybe set up a session variable so when someone clicks on another FAMILY, my subfamily list automaticaly changes, and so does my group list, and so does my default product (acccording to the family,subfamily and group)?

    I how someone can help me with this.

    Thanks in advice.


  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    assuming you are using PHP in a web environment, and you want a standard user interface action then you have two options, both of which use javascript.

    one is to declare the list boxes in a form and then set the onchange event handler
    the other is to use AJAX and update only the aprts fo the form that have changed.

    Of the two Javascript is the slicker interface.. but i can be a pig to debug, using Ajax should lighten the load on the server and the network. Conceivably if your information is fairly static and relatively small in size... then you could send all the listbox data in the intial page load and use Javascript to handle which element of the data set to show

    as all such methods use Javascript I think you also need to have an update button, unless you can coerce your users to have Javascript turned on.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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