本文整理汇总了PHP中B::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP B::insert方法的具体用法?PHP B::insert怎么用?PHP B::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类B
的用法示例。
在下文中一共展示了B::insert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: B
<?php
$masp = $_POST["masanpham"];
$dg = $_POST["dongia"];
$sl = $_POST["soluong"];
$tt = $_POST["thanhtien"];
$b = new B();
$sql = "insert into hoadon(MaHD,TenKhachHang,SoDienThoai,DiaChi,ThanhTien) values('','','','','{$tt}')";
$arr = array(" '', '', '', '', '{$tt}' ");
//print_r($arr);
$s = $b->insert($sql, $arr);
$ct = $b->select("select * from hoadon ");
foreach ($ct as $s) {
$mhd = $s["MaHD"];
$sql2 = "insert into chitiethoadon(MaChiTiet,MaSanPham,MaHD,DonGia,SoLuong) values('','{$masp}','{$mhd}','{$dg}','{$sl}') ";
$arr = array("'','{$masp}','{$mhd}','{$dg}','{$sl}'");
print_r($arr);
}
?>
示例2: B
<?php
$mncc = $_POST["mancc"];
$tncc = $_POST["tenncc"];
$lh = $_POST["LH"];
$a = new B();
$sql = "insert into nhacungcap(MaNCC,TenNCC,LienHe) values('{$mncc}','{$tncc}','{$lh}') ";
$arr = array("'{$mncc}','{$tncc}','{$lh}'");
$q = $a->insert($sql, $arr);
?>
<script >
window.location="index.php?mod=dsnhacungcap";
</script>
示例3: B
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
include "../class/b.class.php";
$c = new B();
$ma = $_POST["masanpham"];
$nd = $_POST["noidung"];
$t = "insert into binhluan(Masanpham,noidung) values('{$ma}','{$nd}') ";
$r = array("'{$ma}','{$nd}'");
$n = $c->insert($t, $r);
if ($nd == null) {
?>
<script language="javascript">
alert("bạn phải nhập ít nhất 1 từ");
window.location="../index.php?mod=chitiet&Masanpham=<?php
echo $ma;
?>
";
</script>
<?php
} else {
if ($nd != null) {
?>
<script language="javascript">
alert("đã thêm bình luận");
window.location="../index.php?mod=chitiet&Masanpham=<?php
echo $ma;
?>
";
</script>
<?php