我有三个按钮,编辑删除并查看。在查看部分,我正在尝试回声行ID以获取详细信息。但是我得到了这个解析错误。
这是代码:
while( $row=mysqli_fetch_array($query) ) {
$active = '';
if($row['active'] == 1) {
$active = '<label class="label label-success">Complete</label>';
} else {
$active = '<label class="label label-danger">Incomplete</label>';
}
$actionButton = '
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data- toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Action <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a type="button" data-toggle="modal" data-backdrop="static" data-keyboard="false" data-target="#editMemberModal" onclick="editMember('.$row['id'].')"> <span class="glyphicon glyphicon-edit"></span> Edit</a></li>
<li><a type="button" data-toggle="modal" data-target="#removeMemberModal" onclick="removeMember('.$row['id'].')"> <span class="glyphicon glyphicon-trash"></span> Remove</a></li>
<li><a class="view_data" type="button" data-toggle="modal" data-target="#dataModal" id="'.<?php echo $row['id']; ?>.'"><span class="glyphicon glyphicon-trash"></span> View</a></li>
</ul>
</div>
';
在下拉菜单第三列表上面对此错误。类是View_data
检查您的最后一个li按照下面的方式更改它:
<li><a class="view_data" type="button" data-toggle="modal" data-target="#dataModal" id="' . $row['id'] . '"><span class="glyphicon glyphicon-trash"></span> View</a></li>
在上面的代码结束中,}
终于缺少