如何在php中放置编辑按钮,在bootstrap中显示模态?

时间:2016-10-25 04:05:41

标签: php

我正在尝试在bootstap模式中编辑我的数据,但我不知道如何将 href 放在将触发模态的按钮

我正在尝试以下内容:

$query = "SELECT * FROM masterlist_tbl";
$result = mysql_query($query);
$number_rows = mysql_num_rows($result);
$query = "SELECT distinct(student_num) FROM masterlist_tbl";
if($number_rows>=1){
while($row = mysql_fetch_array($result)){

$table.="<tr class='td-ojt-student'>
<td class='th-ojt-student'> ".$row[0]." </td>
<td class='th-ojt-student'> ".$row[1]." </td>
<td class='th-ojt-student'> ".$row[2]." </td>
<td class='th-ojt-student'> ".$row[3]." </td>
<td class='th-ojt-student'> ".$row[4]." </td>
<td class='th-ojt-student'> ".$row[5]." </td>
<td class='th-ojt-student'> ".$row[6]." </td>
<td class='th-ojt-student'> ".$row[7]." </td>
<td class='th-ojt-student'>
// Edit Button
        <a href='?Edit_1=".$row[0]."'>
        <button class='btn btn-primary btn-xs' data-title='Edit' data-toggle='modal' data-target='#edit-company'>
            <span class='glyphicon glyphicon-pencil'>
            </span>
        </button>
        </a>
</td>
</tr>";
}
$table.="</table>";
}else{
$table.="<tr><td colspan='18' align='center'>NO Data</td></tr></table>";
}
echo $table;

0 个答案:

没有答案