我有两个按钮 prev/next 调用getJSON
. 我想根据单击的按钮更改查询。这是我的按钮和getjson
语句
<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)
我想使用LoadNumber
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)'
};