How to make a button to query

How to make a button to query

xtrapspxtrapsp Posts: 7Questions: 0Answers: 0
edited January 2013 in General
Hey guys,

Just got DT working on my site and I'm pretty new to PHP etc, I know a little. But I was wondering if it was possible to make a button query something specific...

For example lets say I have this information:

Name | Next Service |
John | 06/02/2013 |
Jeff | 12/01/2013 |

Is there a way to make it filter by only showing the people who's next service date is already past the current date?

[code] $query = "SELECT id, customer_name, address, postcode, telephone, mobile, mobiletwo, email, nservice
FROM Customers WHERE DATEDIFF (CURDATE(), nservice) > 0"; [/code] or something

Replies

  • xtrapspxtrapsp Posts: 7Questions: 0Answers: 0
    Ended up making a view table and querying that instead
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    That's one option - there are always lots. Another would be to use a client-side custom filter and apply a date range to the data. Something similar is done here (although with numbers, rather than dates): http://datatables.net/release-datatables/examples/plug-ins/range_filtering.html

    Allan
This discussion has been closed.