本文整理汇总了PHP中CRUD::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP CRUD::insert方法的具体用法?PHP CRUD::insert怎么用?PHP CRUD::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRUD
的用法示例。
在下文中一共展示了CRUD::insert方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public static function add($newItem)
{
$val_description = $_POST[$newItem][0];
$val_quantity = $_POST[$newItem][1];
$val_price = $_POST[$newItem][2];
$crud = new CRUD();
$crud->insert(' itens ', ' description=?, qty=?, price=? ', array($val_description, $val_quantity, $val_price));
return $crud;
}
示例2: CRUD
<?php
include "model/_crud.mysqli.oop.php";
$crud = new CRUD("localhost", "root", "", "restoran");
$connection = mysql_connect("localhost", "root", "");
$db = mysql_select_db("restoran");
$nmor_meja = @$_POST['mm'];
$sql = mysql_query("SELECT * FROM meja where tmpmeja='{$nmor_meja}'");
$data = mysql_fetch_array($sql);
$cek = mysql_num_rows($sql);
if ($cek > 0) {
header('location:index.php');
} else {
session_start();
@($_SESSION['nomor_meja'] = $nmor_meja);
$data = array('no' => '', 'tmpmeja' => $nmor_meja);
$crud->insert('meja', $data);
header('location:menu.php');
}
?>
示例3: explode
<?php
require_once "CRUD.php";
$req = '';
$text = '';
if ($_REQUEST["str"]) {
$req .= $_REQUEST["str"];
$params = explode("/", $req);
$crud = new CRUD();
$sucess = $crud->insert('Cliente', 'nome=?, telefone=?, email=?', array($params[0], $params[1], $params[2]));
}
//echo 'Done!';
示例4: CRUD
<?php
include "../model/_crud.mysqli.oop.php";
$crud = new CRUD("localhost", "root", "", "restoran");
$keterangan = @$_POST['keterangan'];
$nama = @$_POST['nama'];
$gambar = @$_FILES['gambar']['tmp_name'];
$target = '../tampilan/img/';
$harga = @$_POST['harga'];
$nama_gambar = @$_FILES['gambar']['name'];
$pindah = move_uploaded_file($gambar, $target . $nama_gambar);
if ($pindah) {
$data = array('nama' => $nama, 'gambar' => $nama_gambar, 'harga' => $harga, 'keterangan' => $keterangan);
$crud->insert('makanan', $data);
header('location:../admin.php');
} else {
?>
<script type="text/javascript">
alert('gambar gagal di upload');
</script>
<?php
echo "ada yang salah";
echo "{$nama}";
echo "{$gambar}";
echo "{$harga}";
}
示例5: CRUD
<?php
require_once "/../class/ConDB.class.php";
$pergunta = $_POST['pergunta'];
$resposta = $_POST['resposta'];
$crud = new CRUD();
$crud->insert('faq', 'pergunta=?, resposta=?', array($pergunta, $resposta));
print $pergunta;
示例6: explode
<?php
require_once "CRUD.php";
$req = '';
$text = '';
if ($_REQUEST["str"]) {
$req .= $_REQUEST["str"];
$params = explode("/", $req);
$crud = new CRUD();
$crud->insert('Cliente', 'Nome=?, Telefone=?, Email=?', array($params[0], $params[1], $params[2]));
}
示例7: CRUD
<?php
include "../model/_crud.mysqli.oop.php";
$crud = new CRUD("localhost", "root", "", "restoran");
$no = @$_POST['id'];
$nama = @$_POST['nama'];
$gambar = @$_FILES['gambar']['tmp_name'];
$banyak = @$_POST['banyak'];
$harga = @$_POST['harga'];
$nama_gambar = @$_FILES['gambar']['name'];
$jumlah = $harga * $banyak;
$mmeja = @$_POST['meja'];
$data = array('meja' => $mmeja, 'nama' => $nama, 'noo' => '', 'banyak' => $banyak, 'harga' => $harga, 'total' => $jumlah);
$crud->insert('keranjang', $data);
header('location:../menu.php');
示例8: CRUD
<?php
include "../model/_crud.mysqli.oop.php";
$crud = new CRUD("localhost", "root", "", "restoran");
$nama = @$_POST['nama'];
$username = @$_POST['username'];
$password = @$_POST['password'];
$alamat = @$_POST['alamat'];
$telepon = @$_POST['telepon'];
$jabatan = @$_POST['jabatan'];
$data = array('nama' => $nama, 'username' => $username, 'password' => $password, 'alamat' => $alamat, 'telepon' => $telepon, 'jabatan' => $jabatan);
$crud->insert('pegawai', $data);
header('location:..admin.php');