【发布时间】:2015-11-18 19:19:11
【问题描述】:
目前我已经像
一样编码了<div class="row">
<div class="col-lg-12">
<table id="usertable" class="table table-bordered table-hover text-center">
<thead>
<th class="col-lg-1 text-center">User ID</th>
<th class="col-lg-4 text-center">Username</th>
<th class="col-lg-4 text-center">Password</th>
<th class="col-lg-2 text-center">Role</th>
</thead>
<tbody>
<?php
require('dbconnectmssql.php');
$sql = "select [User_ID],[user_decoded],[pass_decoded],[permission] from [rfttest].[dbo].[users]";
$query = sqlsrv_query ($conn , $sql);
if($query === false)
{die( print_r( sqlsrv_errors(), true));}
while($row = sqlsrv_fetch_array( $query, SQLSRV_FETCH_NUMERIC))
{
echo "<tr>";
foreach($row as $x => $a)
{
echo "<td>".$a."</td>";
}
echo "<td>";
echo "<a href='#' ><span class='glyphicon glyphicon-wrench' aria-hidden='true'></span></a>";
echo "<a href='usercontrol.php?del=$row[0]'>";
echo "<span class='glyphicon glyphicon-trash' aria-hidden='true'></span>";
echo "</a>";
echo "</td>";
echo "</tr>";
}
?>
</tbody>
/table>
</div>
</div>
这都是关于查询并显示表中有多少用户。
- 我已经通过链接到 PHP 文件和 $_GET 数据完成了删除记录(如果您有其他建议的解决方案,以后可能会改进)
我想做的另一件事是
- 编辑特定记录而不重定向到另一个页面
我现在的想法是单击编辑后弹出的隐藏表单,例如我单击然后弹出带有存储的数据记录的表单,用户可以编辑它并通过提交到 PHP 文件来保存它,然后重定向回这个页面
类似:Contain form within a bootstrap popover? 帖子
<a href="#" id="popover">the popover link</a>
<div id="popover-head" class="hide">
some title
</div>
<div id="popover-content" class="hide">
<!-- MyForm -->
</div>
但我还是想不通
- 如何编写代码以使链接打开特定的 popover-head/content 可能 popover-head/content 必须包含在 id 或其他内容中?
- PHP 怎么样
- JS/JQ 呢
任何解决方案我只想要一些东西来编辑回显的特定记录
对不起我的英语不好
谢谢
【问题讨论】:
-
研究 AJAX 来做到这一点
-
你能给我一些关于 AJAX 的例子吗,因为我没有 AJAX 经验:(
标签: javascript php jquery sql-server twitter-bootstrap-3