简体   繁体   English

在PHP的foreach表中添加编辑按钮

[英]adding an edit button in a foreach table in php

请问我该如何正确编写此表,我需要为表的每一行都有一个“编辑”图标。

    echo "<td>"<a href='editservice?edit=.$docrow->getId().'>Edit</a>"</td>";

You are not stitching the string with the variable properly. 您没有用变量正确地缝合字符串。 Try this, 尝试这个,

echo "<td><a href='editservice?edit=".$docrow->getId()."'>Edit</a></td>";

尝试这个:

<td><a href="editservice?edit=<?php echo $docrow->getId()?>">Edit</a></td>
echo '<td><a href="editservice?edit='.$docrow->getId().'">Edit</a></td>';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM