title: Modify SELECT queries using HTML buttons and output results below
body: <p>I am creating a timetable system for students and I need to create a GUI for my SQL outputs.</p>
  
  <p>So far I have the HTML form to choose the year of the studies, faculty and the language group. You also need to give a valid password to move to the results of thhe query. </p>
  
  <p>All values from form are then submitted using "SUBMIT" bytton and POST method. </p>
  
  <p>The SQL query itself will be more complex, however I want you to get the concept.</p>
  
  <p>I wish to create (using HTML, SQLite and Python or PHP) the following interface:</p>
  
  <p><a href="http://img5.imageshack.us/img5/1951/qb6n.png" rel="nofollow">http://img5.imageshack.us/img5/1951/qb6n.png</a></p>
  
  <p>The field with date will be filled from Python using datetime module.</p>
  
  <p>The main task is to create these buttons. Each of them will modify the SQL query as its name shows.</p>
  
  <p>I can calculate e.g. the day before, the week before, the day after and the week after. I don't know how to combine these buttons so that they will get the date from the field on the top, execute e.g. the SQL for the previous day and show results below. If you want to see the next day then you just click the "NEXT DAY" button and BAM! You get the timetable for the chosen day.</p>
  
  <p>I considered two cases:</p>
  
  <ul>
  <li>to create the HTML website with two frames: the top frame with controls and the bottom frame with results of the query</li>
  </ul>
  
  <p>OR</p>
  
  <ul>
  <li>the website without frames - the whole page will be recreated after every click and the control buttons will be always created at the top and then the result will be shown.</li>
  </ul>
  
  <p>I also do not know how to "store" the "present" date between these queries. Is there a sort of a global variable to store it?</p>
  
  <p>QUESTIONS:</p>
  
  <p><strong>How to create those buttons with SQL queries?</strong></p>
  
  <p><strong>How to output the SQL query and show the buttons before?</strong></p>
  
  <p><strong>How to store the date between queries?</strong></p>
  
  <p>General comments are welcome in case you cannot give an exact answer.</p>
  
  <p>Ask for details if something is not clear.</p>