将变量与链接一起发送或在CI中有更好的方法,这是一个好/坏做法吗?
foreach ($query->result() as $row)
{
echo "<li><a href='samples?tempid=" .$row->id. "'>" .$row->name. "</a></li>";
}
提前致谢
答案 0 :(得分:-1)
尝试改变:
foreach ($query->result() as $row)
{
echo "<li>".anchor('samples/tempid/'.$row->id,$row->name)."</li>";
}