-2
我有三个按钮,编辑删除和查看..在视图部分我试图回显行ID以获取细节。但我得到这个解析错误。PHP错误:解析错误:语法错误,filename.php中出现意外的'<'
这里是代码:
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
错误是否给你一个行号码是多少? – Jerodev
是的,我在下拉菜单的第三个列表中面对这个错误.. class is view_data –
只需比较你如何连接:''。$ row ['id']。''和''。<?php echo $ row ['' ID']; ?>。看到有什么区别? – Rizier123