Is there a way to tweak the SELECT
statement on the fly using a href or a button, without leaving the page?
On my page I'm retrieving data with this statement:
$sql= $db->prepare("
SELECT * FROM db
WHERE `some` = 'thing' AND mydate >= DATE_SUB(NOW(),INTERVAL 1 YEAR)
ORDER BY `mydate` DESC");
$sql->execute();
What would be cool is if I could display the data in some other way by passing in a variable and at the same time refreshing the page. Let's say a href or button that says "View All"..
I'm thinking maybe this can be done with presetting a few $_GET
variables on the page and fetching with a href/button, but I'm not sure where to begin.