本文整理匯總了PHP中CRUD::deleteMhs方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRUD::deleteMhs方法的具體用法?PHP CRUD::deleteMhs怎麽用?PHP CRUD::deleteMhs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRUD
的用法示例。
在下文中一共展示了CRUD::deleteMhs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CRUD
<table class='table table-bordered table-responsive'>
<tr>
<th>NPM</th>
<th>Nama</th>
<th>Kelas</th>
<th>Nilai</th>
<th colspan="2" >Action</th>
</tr>
<?php
require "crud.php";
$obj = new CRUD();
$show = $obj->showMhs();
while ($data = $show->fetch(PDO::FETCH_OBJ)) {
echo "\n\t<tr>\n\t\t<td>{$data->NPM}</td>\n\t\t<td>{$data->nama}</td>\n\t\t<td>{$data->kelas}</td>\n\t\t<td>{$data->nilai}</td>\n\t\t<td><center><a class='btn btn-info' href='edit.php?npm={$data->NPM}'>Edit</center></td>\n\t\t<td><center><a class='btn btn-danger' href='list.php?delete={$data->id_mhs}'>Delete</a></center></td>\n\t</tr>";
}
?>
</table>
<a href="index.php" class="btn btn-success">Tambah Nilai</a>
</div>
</body>
</html>
<?php
if (isset($_GET['delete'])) {
$del = $obj->deleteMhs($_GET['delete']);
if ($del == "Success") {
header('Location: list.php');
}
}