Hi guys,
I’m relatively new to MODx, and so far I’m absolutely loving it. It’s a great CMS and it’s very easy to develop sites.
I have however come across what would seem to be a very simple problem (I could do this in minutes working with just HTML, PHP and MySQL), yet I’ve spent many hours trawling for a solution and cannot seem to work it out. I’m sure it’s a simple solution, but I just can’t work it out.
The problem I have is this - I want to display content on a page (document) based on the results of a query to a different MySQL database to where modx is installed. So what needs to happen is this:
1) User selects a month from a drop down box and click "submit"
2) This value is passed to a snippet which runs a query with the parameter value passed from the select box in the WHERE statement
3) Query results are displayed on the page
I can write the PHP to create the recordset and display it on the page, but where I’m struggling is how to generate the parameter and pass this into the snippet.
The way I would "normally" do this (without a CMS) would be to produce a form with a select box, with the values and labels dynamically produced by a query. The user then selects the correct option, clicks submit, and the page refreshes with the results of the query shown.
I’m open to other methods of doing this. All I really need to achieve is to have a user select a month and the query return all the valid results from a table where the event happens in that month.
Can anyone help before my brain explodes?
Many thanks in advance,
Jon
I’ve managed to work this out now. It was simply a case of not getting my head around the architecture properly. Apologies for the silly question!