I have two butons prev/next that call a getJSON
. I want to alter a query depnding on what button if any were clicked. Here are my buttons and getjson
statments
<input class="buttonsr" type="button" onClick="next()" name="NextLoad" value="Next Load"><input class="buttonsr" type="button" onClick="prev()"name="PrevLoad" value="Prev. Load">
$.getJSON("loadloads.php", document.getElementById('LoadNumber').value, jsonhandler)
I'd like to do something like below using the LoadNumber
from the GET.
if isset($_GET['prev']){
$find = 'Where L.$_GET['LoadNumber'] > (max)LoadNumber FROM tblLoads'
}
if isset($_GET['next']){
$find = 'Where L.$_GET['LoadNumber'] < (min)LoadNumber FROM tblLoads'
}
else{
$find = 'L.LoadNumber = (SELECT MAX(LoadNumber) FROM tblLoads)'
};