本文整理汇总了PHP中mysqld_insert函数的典型用法代码示例。如果您正苦于以下问题:PHP mysqld_insert函数的具体用法?PHP mysqld_insert怎么用?PHP mysqld_insert使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysqld_insert函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: member_create_qq
function member_create_qq($qq_openid, $avatar = '', $nickname = '', $gender = 0)
{
if (!empty($qq_openid)) {
$qq_fans = mysqld_select("SELECT * FROM " . table('qq_qqfans') . " WHERE qq_openid=:qq_openid ", array(':qq_openid' => $qq_openid));
if (empty($qq_fans['qq_openid'])) {
$row = array('nickname' => $nickname, 'gender' => intval($gender), 'qq_openid' => $qq_openid, 'avatar' => $avatar, 'createtime' => TIMESTAMP);
mysqld_insert('qq_qqfans', $row);
} else {
$row = array('nickname' => $nickname, 'gender' => intval($gender), 'avatar' => $avatar);
mysqld_update('qq_qqfans', $row, array('qq_openid' => $qq_openid));
}
}
}
示例2: do_formsubmit
public function do_formsubmit()
{
global $_GP;
$id = intval($_GP['id']);
$insert = array('list_id' => $id, 'str1' => $_GP['str1'], 'str2' => $_GP['str2'], 'str3' => $_GP['str3'], 'create_time' => time());
if (!empty($_GP['iscomment'])) {
$insert['str1'] = $_GP['from'];
$insert['str2'] = $_GP['content'];
}
$temp = mysqld_insert('addon10_scene_subscribe', $insert);
if ($temp == false) {
$return = array('data' => 200, 'success' => false, 'message' => iconv('gb2312', 'utf-8', iconv('gb2312', 'utf-8', '提交失败')));
die(json_encode($return));
} else {
$return = array('data' => 200, 'success' => true, 'message' => iconv('gb2312', 'utf-8', '提交成功'));
if (!empty($_GP['iscomment'])) {
$return = array('data' => array('id' => $id, 'date' => date('Y-m-d H:i:s')), 'success' => 1, 'message' => iconv('gb2312', 'utf-8', '提交成功'));
}
die(json_encode($return));
}
}
示例3: do_newkeupload
public function do_newkeupload()
{
global $_CMS;
$result = array('url' => '', 'message' => '', 'error' => 0);
if (!empty($_FILES['imgFile']['name'])) {
if ($_FILES['imgFile']['error'] != 0) {
$result['state'] = '上传失败,请重试!';
exit(json_encode($result));
}
$file = $this->new_file_upload($_FILES['imgFile'], 'other');
if (is_error($file)) {
$result['state'] = $file['message'];
exit(json_encode($result));
}
$result['url'] = $file['path'];
$result['filename'] = $file['path'];
mysqld_insert('attachment', array('uid' => $_CMS['account']['id'], 'filename' => $_FILES['imgFile']['name'], 'attachment' => $result['filename'], 'type' => 1, 'createtime' => TIMESTAMP));
exit(json_encode($result));
} else {
$result['message'] = '请选择要上传的图片!';
$result['error'] = 1;
exit(json_encode($result));
}
}
示例4: mysqld_select
<?php
$code = $_GP['code'];
require WEB_ROOT . '/system/modules/plugin/dispatch/' . $code . '/lang.php';
$item = mysqld_select("SELECT * FROM " . table('dispatch') . " WHERE code = :code", array(':code' => $code));
if (empty($item['id'])) {
$data = array('code' => $code, 'name' => $_LANG['dispatch_' . $code . '_name'], 'desc' => $_LANG['dispatch_' . $code . '_desc'], 'enabled' => '1', 'sendtype' => $_LANG['dispatch_' . $code . '_sendtype']);
mysqld_insert('dispatch', $data);
} else {
$data = array('name' => $_LANG['dispatch_' . $code . '_name'], 'desc' => $_LANG['dispatch_' . $code . '_desc'], 'enabled' => '1', 'sendtype' => $_LANG['dispatch_' . $code . '_sendtype']);
mysqld_update('dispatch', $data, array('code' => $code));
}
message("操作成功", create_url('site', array('name' => 'modules', 'do' => 'dispatch', 'op' => 'display')));
示例5: mysqld_selectall
}
$paymentlist = mysqld_selectall("select * from " . table("payment") . " where `enabled`=1 and `code`!='gold' and `online`=1 {$paymentconfig} ");
$paymentscount = mysqld_selectcolumn("select count(id) from " . table("payment") . " where `enabled`=1 and `code`!='gold' and `online`=1 {$paymentconfig} ");
if (empty($paymentscount)) {
message("未找到可用的在线支付方式,暂时不支持余额充值。");
}
if (checksubmit("submit")) {
if (empty($_GP['charge']) || round($_GP['charge'], 2) <= 0) {
message("请输入要充值的金额");
}
$paytypecode = $_GP['paymentcode'];
if (empty($paytypecode)) {
message("请选择充值方式。");
}
$payment = mysqld_select("select * from " . table("payment") . " where `enabled`=1 and `code`=:code and `code`!='gold' and `online`=1", array('code' => $paytypecode));
if (empty($payment['id'])) {
message("未找到付款方式,付款失败");
}
$goodtitle = "余额充值" . $_GP['charge'] . "元";
$ordersn = 'bg' . date('Ymd') . random(6, 1);
$gold_order = mysqld_select("SELECT * FROM " . table('gold_order') . " WHERE ordersn = '{$ordersn}'");
if (!empty($gold_order['ordersn'])) {
$ordersn = 'bg' . date('Ymd') . random(6, 1);
}
$insert = array('openid' => $openid, 'ordersn' => $ordersn, 'price' => $_GP['charge'], 'status' => 0, 'createtime' => TIMESTAMP);
mysqld_insert('gold_order', $insert);
$order = mysqld_select("SELECT * FROM " . table('gold_order') . " WHERE ordersn = '{$ordersn}' and openid='{$openid}'");
require WEB_ROOT . '/system/modules/plugin/payment/' . $paytypecode . '/gold_payaction.php';
exit;
}
include themePage('rechargegold');
示例6: message
}
if (empty($_GP['third_login'])) {
if (empty($_GP['pwd'])) {
message("请输入密码!");
}
$pwd = md5($_GP['pwd']);
} else {
$pwd = '';
}
$shop_regcredit = intval($cfg['shop_regcredit']);
$openid = date("YmdH", time()) . rand(100, 999);
$hasmember = mysqld_select("SELECT * FROM " . table('member') . " WHERE openid = :openid ", array(':openid' => $openid));
if (!empty($hasmember['openid'])) {
$openid = date("YmdH", time()) . rand(100, 999);
}
$data = array('mobile' => $_GP['mobile'], 'pwd' => $pwd, 'createtime' => time(), 'status' => 1, 'istemplate' => 0, 'experience' => 0, 'openid' => $openid);
mysqld_insert('member', $data);
if (!empty($shop_regcredit)) {
member_credit($openid, $shop_regcredit, "addcredit", "注册系统赠送积分");
}
$member = get_session_account();
$oldsessionid = $member['openid'];
$loginid = save_member_login('', $openid);
integration_session_account($loginid, $oldsessionid);
message('注册成功!', to_member_loginfromurl(), 'success');
}
$qqlogin = mysqld_select("SELECT * FROM " . table('thirdlogin') . " WHERE enabled=1 and `code`='qq'");
if (!empty($qqlogin) && !empty($qqlogin['id'])) {
$showqqlogin = true;
}
include themePage('regedit');
示例7: mysqld_select
<?php
$code = $_GP['code'];
require WEB_ROOT . '/system/modules/plugin/thirdlogin/' . $code . '/lang.php';
$item = mysqld_select("SELECT * FROM " . table('thirdlogin') . " WHERE code = :code", array(':code' => $code));
if (empty($item['id'])) {
$data = array('code' => $code, 'name' => $_LANG['thirdlogin_' . $code . '_name'], 'enabled' => '0');
mysqld_insert('thirdlogin', $data);
} else {
$data = array('name' => $_LANG['thirdlogin_' . $code . '_name']);
mysqld_update('thirdlogin', $data, array('code' => $code));
}
$this->do_thirdlogin_config();
示例8: array
<?php
if (checksubmit("submit")) {
$insert = array('title' => $_GP['title'], 'amount' => intval($_GP['amount']), 'endtime' => strtotime($_GP['endtime']), 'price' => $_GP['price'], 'gold' => $_GP['gold'], 'awardtype' => intval($_GP['awardtype']), 'credit_cost' => intval($_GP['credit_cost']), 'createtime' => time(), "deleted" => 0, 'content' => htmlspecialchars_decode($_GP['content']));
if (!empty($_FILES['logo']['tmp_name'])) {
$upload = file_upload($_FILES['logo']);
if (is_error($upload)) {
message($upload['message'], '', 'error');
}
$logo = $upload['path'];
}
if (!empty($logo)) {
$insert['logo'] = $logo;
}
mysqld_insert('addon7_award', $insert);
message('保存成功', web_url('awardlist'), 'success');
}
include addons_page('award');
示例9: explode
$ids = $option_idss[$k];
$idsarr = explode("_", $ids);
$newids = array();
foreach ($idsarr as $key => $ida) {
foreach ($spec_items as $it) {
if ($it['get_id'] == $ida) {
$newids[] = $it['id'];
break;
}
}
}
$newids = implode("_", $newids);
$a = array("title" => $_GP['option_title_' . $ids][0], "productprice" => $_GP['option_productprice_' . $ids][0], "costprice" => $_GP['option_costprice_' . $ids][0], "marketprice" => $_GP['option_marketprice_' . $ids][0], "stock" => $_GP['option_stock_' . $ids][0], "weight" => $_GP['option_weight_' . $ids][0], "goodsid" => $id, "specs" => $newids);
$totalstocks += $a['stock'];
if (empty($get_option_id)) {
mysqld_insert("shop_goods_option", $a);
$option_id = mysqld_insertid();
} else {
mysqld_update("shop_goods_option", $a, array('id' => $get_option_id));
$option_id = $get_option_id;
}
$optionids[] = $option_id;
}
if (count($optionids) > 0) {
mysqld_query("delete from " . table('shop_goods_option') . " where goodsid={$id} and id not in ( " . implode(',', $optionids) . ")");
} else {
mysqld_query("delete from " . table('shop_goods_option') . " where goodsid={$id}");
}
//总库存
if ($totalstocks > 0) {
mysqld_update("shop_goods", array("total" => $totalstocks), array("id" => $id));
示例10: mysqld_update
if ($order['status'] == 0) {
mysqld_update('gold_order', array('status' => 1), array('id' => $order['id']));
mysqld_insert('paylog', array('typename' => '余额充值成功', 'pdate' => $post_data, 'ptype' => 'success', 'paytype' => 'alipay'));
member_gold($order['openid'], $order['price'], 'addgold', '余额在线充值-支付宝支付');
}
message('余额充值成功!', WEBSITE_ROOT . 'index.php?mod=mobile&name=shopwap&do=fansindex', 'success');
} else {
mysqld_insert('paylog', array('typename' => '余额充值未找到订单', 'pdate' => $post_data, 'ptype' => 'error', 'paytype' => 'alipay'));
message('余额充值未找到订单!', WEBSITE_ROOT . 'index.php?mod=mobile&name=shopwap&do=fansindex', 'error');
exit;
}
}
}
$response_msg = "trade_status=" . $_GET['trade_status'];
} else {
mysqld_insert('paylog', array('typename' => '验证失败', 'pdate' => $post_data, 'ptype' => 'error', 'paytype' => 'alipay'));
$response_msg = $response_msg . "验证失败";
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>支付宝手机网站支付接口</title>
</head>
<body>
<?php
echo $response_msg;
?>
</body>
</html>
示例11: mysqld_select
<?php
$setting = mysqld_select("SELECT * FROM " . table('addon7_config'));
if (checksubmit("submit")) {
$cfg = array('title' => $_GP['title']);
mysqld_delete('addon7_config', array());
mysqld_insert('addon7_config', $cfg);
message('保存成功', 'refresh', 'success');
}
include addons_page('setting');
示例12: message
if (is_error($upload)) {
message($upload['message'], '', 'error');
}
$data['cover2'] = $upload['path'];
}
if (!empty($_GP['bg_music_url_del'])) {
$data['bg_music_url'] = '';
}
if (!empty($_FILES['bg_music_url']['tmp_name'])) {
$upload = file_upload($_FILES['bg_music_url'], 'music');
if (is_error($upload)) {
message($upload['message'], '', 'error');
}
$data['bg_music_url'] = $upload['path'];
}
mysqld_insert('addon10_scene_list', $data);
message("添加成功", create_url('site', array('name' => 'addon10', 'do' => 'scene', 'op' => 'setting', 'id' => mysqld_insertid())), "success");
} else {
$fields = array('title', 'reply_title', 'reply_description', 'share_title', 'share_content', 'share_cb_url', 'share_cb_tel', 'first_type', 'first_btn_select', 'first_btn_url', 'first_btn_tel', 'bg_music_switch', 'bg_music_icon', 'cover_title', 'cover_subtitle', 'tongji');
$data = array();
foreach ($_GP as $k => $v) {
if (in_array($k, $fields)) {
$data[$k] = $_GP[$k];
}
}
if (!empty($theme)) {
$data['theme'] = $theme;
}
if (!empty($_GP['reply_thumb_del'])) {
$data['reply_thumb'] = '';
}
示例13: mysqld_select
<?php
$code = $_GP['code'];
require WEB_ROOT . '/system/modules/plugin/payment/' . $code . '/lang.php';
$item = mysqld_select("SELECT * FROM " . table('payment') . " WHERE code = :code", array(':code' => $code));
if (empty($item['id'])) {
$data = array('code' => $code, 'name' => $_LANG['payment_' . $code . '_name'], 'desc' => $_LANG['payment_' . $code . '_desc'], 'enabled' => '0', 'iscod' => $_LANG['payment_' . $code . '_iscod'], 'online' => $_LANG['payment_' . $code . '_online']);
mysqld_insert('payment', $data);
} else {
$data = array('name' => $_LANG['payment_' . $code . '_name'], 'desc' => $_LANG['payment_' . $code . '_desc'], 'iscod' => $_LANG['payment_' . $code . '_iscod'], 'online' => $_LANG['payment_' . $code . '_online']);
mysqld_update('payment', $data, array('code' => $code));
}
$this->do_payment_config();
示例14: message
if ($op == 'display') {
if (checksubmit('submit')) {
if (empty($_GP['charge']) || round($_GP['charge'], 2) <= 0) {
message("请输入要充值的金额");
}
$fee = round($_GP['charge'], 2);
if ($fee > $member['gold']) {
message('账户余额不足,最多能提取' . $member['gold'] . '元');
}
$ordersn = 'rg' . date('Ymd') . random(6, 1);
$gold_order = mysqld_select("SELECT * FROM " . table('gold_teller') . " WHERE ordersn = '{$ordersn}'");
if (!empty($gold_order['ordersn'])) {
$ordersn = 'rg' . date('Ymd') . random(6, 1);
}
member_gold($openid, $fee, 'usegold', '余额提取' . $fee . '元');
mysqld_insert('gold_teller', array('openid' => $openid, 'fee' => $fee, 'status' => 0, 'ordersn' => $ordersn, 'createtime' => time()));
message('余额提取申请成功!', 'refresh', 'success');
exit;
}
$applygold = mysqld_selectcolumn("select sum(fee) from " . table("gold_teller") . " where status=0 and openid=" . $openid);
if (empty($applygold)) {
$applygold = '0';
}
include themePage('outchargegold');
exit;
}
if ($op == 'history') {
$pindex = max(1, intval($_GP['page']));
$psize = 20;
$list = mysqld_selectall("select * from " . table("gold_teller") . " where openid=:openid order by createtime desc LIMIT " . ($pindex - 1) * $psize . ',' . $psize, array(":openid" => $openid));
$total = mysqld_selectcolumn('SELECT COUNT(*) FROM ' . table('gold_teller') . " where openid=:openid ", array(":openid" => $openid));
示例15: message
message('商品不能空', refresh(), 'error');
}
if (checksubmit("submit")) {
$optionid = intval($_GP['optionid']);
$option = mysqld_select("select * from " . table("shop_goods_option") . " where id=:id limit 1", array(":id" => $optionid));
if ($item['status'] != 3) {
message('订单未完成不能评论', refresh(), 'error');
}
if (empty($_GP['rsreson'])) {
message('请输入评论内容', refresh(), 'error');
}
$shop_order_goods = mysqld_select("select * from " . table("shop_order_goods") . " where id=:id limit 1", array(":id" => $ogsid));
if (!empty($shop_order_goods['iscomment'])) {
message('订单已评论', refresh(), 'error');
}
mysqld_insert('shop_goods_comment', array('createtime' => time(), 'rate' => $_GP['rate'], 'ordersn' => $item['ordersn'], 'optionname' => $option['title'], 'goodsid' => $shop_order['goodsid'], 'comment' => $_GP['rsreson'], 'orderid' => $orderid, 'openid' => $openid));
mysqld_update('shop_order_goods', array('iscomment' => 1), array('id' => $ogsid));
message('评论成功!', mobile_url('myorder', array('status' => intval($_GP['fromstatus']))), 'success');
}
include themePage('order_detail_comment');
exit;
}
if ($op == 'returnpay') {
$orderid = intval($_GP['orderid']);
$item = mysqld_select("SELECT * FROM " . table('shop_order') . " WHERE id = :id AND openid = :openid", array(':id' => $orderid, ':openid' => $openid));
$dispatch = mysqld_select("select id,dispatchname,sendtype from " . table('shop_dispatch') . " where id=:id limit 1", array(":id" => $item['dispatch']));
if (empty($item)) {
message('抱歉,您的订单不存在或是已经被取消!', mobile_url('myorder'), 'error');
}
$opname = "退款";
if (checksubmit("submit")) {