Php 使用基于筛选器的jquery自动加载表
我需要帮助创建jquery函数,以便在每次更改表单onchange=loadtable上的用户id时,在id=notes\u table上的表单上自动加载一个表。所以我需要一个jquery代码函数 **形式**Php 使用基于筛选器的jquery自动加载表,php,jquery,html,Php,Jquery,Html,我需要帮助创建jquery函数,以便在每次更改表单onchange=loadtable上的用户id时,在id=notes\u table上的表单上自动加载一个表。所以我需要一个jquery代码函数 **形式** <!DOCTYPE html> <html> <script src="http://code.jquery.com/jquery-1.10.2.js" type="text/javascript"></script> <scri
<!DOCTYPE html>
<html>
<script src="http://code.jquery.com/jquery-1.10.2.js" type="text/javascript"></script>
<script src="./action/scripts/global2.js" type="text/javascript"></script>
<body>
User Id:<input type="text" name="user_id" id="user" onchange="loadtable">
<p>Note List</p>
<div id="notes_table">Lode Notes table here</div>
</body>
</html>
**query.php**
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 100%;
border-collapse: collapse;
}
table, td, th {
border: 1px solid black;
padding: 5px;
}
th {text-align: left;}
</style>
</head>
<body>
<?php
$q = $_POST['user_id'];
include '../db/connect.php';
mysqli_select_db($con,"db3");
$sql="SELECT * FROM oz2ts_call_logs WHERE member_id = '".$q."'";
$result = mysqli_query($con,$sql);
echo "<table class=\"optable\">
<tr>
<th>Device ID</th>
<th>Title</th>
<th>Note</th>
<th>Status</th>
<th>Case Number</th>
</tr>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['device_id'] . "</td>";
echo "<td>" . $row['title'] . "</td>";
echo "<td>" . $row['description'] . "</td>";
echo "<td>" . $row['status'] . "</td>";
echo "<td>" . $row['case_number'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
</body>
</html>
Is$q=$\u POST['user\u id'];应该在PHP部分中吗?july james,向我们展示您到目前为止使用的javascript代码,因为我可以看到您正在调用onchange,您是在寻求帮助还是说要为您做些什么?我没有使用PHP进行任何j查询,但我不希望每次都重新加载页面。所以我想要一个名为loadtable的jquery函数,或者什么averonchange@wogsland它是$q=$\u POST['user\u id'];我能帮上忙吗。我仍在学习jquery,在实践中需要帮助\