本文整理匯總了PHP中CRUD::fetch方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRUD::fetch方法的具體用法?PHP CRUD::fetch怎麽用?PHP CRUD::fetch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRUD
的用法示例。
在下文中一共展示了CRUD::fetch方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
echo $pkmeja;
?>
</th>
<th>Nama</th>
<th>Harga</th>
<th>Qty</th>
<th>bill</th>
<th>opt</th>
</tr>
</thead>
<?php
$total_bil = 0;
$no = 1;
$pkmeja;
$row = $crud->fetch("keranjang", "meja = '{$pkmeja}'");
foreach ($row as $data) {
?>
<tr>
<td><?php
echo $no++;
?>
</td>
<td><?php
echo $data['nama'];
?>
</td>
<td><?php
echo $data['harga'];
?>
示例2: CRUD
<?php
session_start();
if (@$_SESSION['nomor_meja']) {
$pkmeja = @$_SESSION['nomor_meja'];
include "../model/_crud.mysqli.oop.php";
$crud = new CRUD("localhost", "root", "", "restoran");
$id = $_POST['id'];
$data = $crud->fetch("makanan", "no = '{$id}'");
?>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel"><b>Makanan Yang Akan Dibeli</b></h4>
</div>
<div class="modal-body">
<div class="container">
<form action="../nenek/controler/tambah_keranjang.php" method="post" enctype="multipart/form-data">
<div class="col-sm-1">
<img src="../nenek/tampilan/img/<?php
echo $data[0]['gambar'];
?>
" alt="asdsadas" class="img-circle" width="200px">
<input type="hidden" name="nama" class="form-control" value="<?php
echo $data[0]['nama'];
?>
" >
示例3:
<th><?php
$kde = @$_POST['mm'];
echo $kde;
?>
</th>
<th>Nama</th>
<th>Harga</th>
<th>Qty</th>
<th>bill</th>
<th>opt</th>
</tr>
</thead>
<?php
$total_bil = 0;
$no = 1;
$row = $crud->fetch('keranjang');
foreach ($row as $data) {
?>
<tr>
<td><?php
echo $no++;
?>
</td>
<td><?php
echo $data['nama'];
?>
</td>
<td><?php
echo $data['harga'];
?>
</td>
示例4: elseif
echo "ini adalah informasi meja";
} elseif (@$_GET['page'] == 'inpesanan') {
?>
<div class="row">
<div class="col-md-8">.col-md-8</div>
<div class="col-md-4">
<div class="table table-bordered">
<table class="table">
<tr>
<th>No</th>
<th>Tempat </th>
</tr>
<?php
$no = 1;
$row = $crud->fetch('meja');
foreach ($row as $data) {
?>
<tr>
<td><?php
echo $no++;
?>
</td>
<td><?php
echo $data['tmpmeja'];
?>
</td>
</tr>
<?php
示例5:
<div ="row">
<table class="table table-striped">
<thead>
<tr>
<th>No.</th>
<th>Nama Makanan.</th>
<th>Gambar Makanan</th>
<th>Harga Makanan.</th>
<th>Keterangan.</th>
</tr>
</thead>
<?php
$no = 1;
$row = $crud->fetch("makanan");
foreach ($row as $data) {
?>
<tr>
<td><?php
echo $no++;
?>
</td>
<td><?php
echo $data['nama'];
?>
</td>
<td><img src="tampilan/img/<?php
echo $data['gambar'];
?>