So i'm fairly new to php, i was hoping maybe some would give me some pointers on what im trying to do ...

Basically its going to be on bus routes and timetables... So i'm going to have two dropdown menus, one for to and the other for from ... based on what they select there the values of the two dropdown menus will match up with two values listed in the database, and as a result generate information about the routes to and from those places selected ...

    First table would have a list of locations, and a corresponding identifier.

    Second table would have two columns, each listing the location identifier for 'To' and 'From'. Alongside this would the information you wish to display.

    Simple input form for displaying two drop-down boxes, populated by the first table. Once submitted, the variables from the two drop-down boxes will query the second table, and return all mathcing rows that match your 'To' and 'From' selection.

    Have a look at http://www.php.net/ for help on functions querying SQL databases (e.g. MySQL)

      Thanks...

      and return all mathcing rows that match your 'To' and 'From' selection

      Is it possible for the with regards to this part, to generate the results on the same page as the form or it will have to be a new page?

        Yep - as you submit the page, point it to itself and check whether the $POST array has been set and populated. So in your form, if the two drop-down boxes were called 'cboTo' and 'cboFrom', you would check $POST["cboTo"] and $_POST["cboFrom"].

        If they were not set and populated, just display the input form.

          Write a Reply...