에 $ _GET 변수를 전달합니다. 여러 MySQL 쿼리의 테이블을 표시하는 PHP 페이지가 있고 그 결과에서 열 결과를 정렬하는 JavaScript 함수를 사용할 수 있습니다. 문제가 해결되면 결과를 새로 고쳐야합니다. (메타 새로 고침과 함께) 10 초마다 또는 그와 같은 쿼리가 잘 작동하는 경우 문제는 열 정렬 후 새로 고침입니다. 페이지가 새로 고침되면 정렬도 다시 설정됩니다. 다음은 정렬 함수 스 니펫입니다. 여기 자바 스크립트 함수
<script>
function tablesort(which){ <-----I tried using the $_GET method you suggested
<-----But i get a "missing formal parameter" error
<-----When also using this suggestion and use the
<-----"onclick" i get a "tablesort" is not defined
<-----error
$(document).ready(function(){
if(which == '1.0'){<!--This sorts the pause row, descending -->
$("#Mtable").tablesorter({sortList: [[1,0]]});
}
if(which == '2.1'){<!--This sorts the total dialer row, descending -->
$("#Mtable").tablesorter({sortList: [[2,1]]});
}
if(which == '3.0'){<!--This sorts Wrap-up time row, descending -->
$("#Mtable").tablesorter({sortList: [[3,0]]});
}
if(which == '4.1'){<!--This sorts donation amount row, descending -->
$("#Mtable").tablesorter({sortList: [[4,1]]});
}
if(which == '5.1'){<!--This sorts Up-sale row, descending -->
$("#Mtable").tablesorter({sortList: [[5,1]]});
}
if(which == '6.1'){<!--This sorts the Monthl donation row, descending -->
$("#Mtable").tablesorter({sortList: [[6,1]]});
}
if(which == '7.1'){<!--This sorts the verified sales row, descending -->
$("#Mtable").tablesorter({sortList: [[7,1]]});
}
if(which == '8.1'){<!--This sorts the calles per hour row, descending -->
$("#Mtable").tablesorter({sortList: [[8,1]]});
}
if(which == '9.1'){<!--This sorts the payments per hour row, descending -->
$("#Mtable").tablesorter({sortList: [[9,1]]});
}
if(which == '10.1'){<!--This sorts the average sale row, descending -->
$("#Mtable").tablesorter({sortList: [[10,1]]});
}
if(which == '11.1'){<!--This sorts the sales total row, descending -->
$("#Mtable").tablesorter({sortList: [[11,1]]});
}
});
}
</script>
때문에 그래서 것 $ _GET 유사한 URL에 onlcick에서 변수 데이터를 전달하고자 새로 고침 메신저의 테이블 '
Sort by:
<a onclick="tablesort('1.0')"> Lowest Pause<a/>   
<a onclick="tablesort('2.1')"> Highest Dialer<a/>   
<a onclick="tablesort('3.0')"> Best Wrap-up<a/>   
를 정렬 링크입니다 법한 그런 다음 정렬 기능을 읽습니다.
2.1 <를 = 로컬 호스트/dbtabke.php은? ---- 정확한 URL의 예는 사전에
그 작업을 수행하는 방법에 대한 도움
크게 감사하겠습니다 감사를 사용.@prabeen 기리 난 덕분에 다시
'$의 갔지'(... + sort_by_var '/ dbtabke.php? Mtable = 로컬 호스트') 도움이되기를 바랍니다? –
PHP 페이지를 통해 데이터를 다시로드하는 AJAX 요청의 일부로 쿼리 변수를 전달하려고합니다. –
@Mathew Darnell, 새로 고침 부분 때문에 URL을 통해 javascript 함수에 tablesport ('1.0') "데이터를 전달하고 싶습니다. – Iz3k34l