我想从下拉列表中用户选择值后更改内容表中的改变表的内容。有两个下拉菜单 - 一个用于选择用户,另一个用于选择脚本。我希望当用户选择一个用户时,表格将只显示具有所选用户的行和脚本相同的行。 这是我的下拉:根据下拉选择
include_once "dbConnect.php";
$query = "SELECT user_id FROM users";
$result = mysql_query($query); ?>
<select name="select1">
<?php while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { ?>
<option value="<?php echo $line['user_id'];?>">
<?php echo $line['user_id'];?>
</option>
<?php } ?>
</select>
<?php
include_once "dbConnect.php";
$query = "SELECT script_name FROM scripts";
$result = mysql_query($query); ?>
<select name="select1">
<?php while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { ?>
<option value="<?php echo $line['script_name'];?>">
<?php echo $line['script_name'];?>
</option>
<?php } ?>
</select>
多数民众赞成在表中的数据:
$json_response = array();
$results= mysql_query("select user_id,script_name,cron_format from users,scripts");
while ($row = mysql_fetch_array($results, MYSQL_ASSOC)) {
array_push($json_response,$row);
}
echo json_encode($json_response);
,这是表:
<table class="table table-bordered table-hover">
<thead>
<td>user name</td>
<td>script name</td>
<td>cron format</td>
<td>schedule last update</td>
<td>next execution time</td>
<td>script exec</td>
</thead>
<tbody>
<tr ng-repeat="x in data">
<td>{{x.user_id}}</td>
<td>{{x.script_name}}</td>
<td><span class="editme" contenteditable="true">{{x.cron_format}}</span></td>
<td>{{x.schedule_last_update}}</td>
<td>{{x.next_execution_time}}</td>
<td>{{x.script_exec}}</td>
</tr>
</tbody>
</table>
开头表显示所有用户和每个用户所有脚本。 任何解决方案是伟大的,但angularJs一个将是伟大的++ ...谢谢
我们可以看到选择框所得到的'html'? – DelightedD0D 2015-02-08 12:26:37
它的代码 – 2015-02-08 12:32:14
第一和平之间不,我的意思是由PHP – DelightedD0D 2015-02-08 12:33:22