ecshop 输出数组

找到include/cls_template.php文件 
找到get_val()函数,可以在大约629行加入

case 'print_r':
$p = 'print_r(' . $p . ',true)';
break;

在模板里面可以用{$p|print_r}在循环数组的时候打印出数组数据

==================================================

$sql = "UPDATE " . $GLOBALS['ecs']->table('form_claim') .
" SET status = 0" .
" WHERE id = '$id'";
$db->query($sql);


$link[] = array('text' => '删除成功', 'href'=>'form_claim.php?act=list');
sys_msg('删除成功', 0, $link);
exit;

==================================================

 

 

 

=============================

添加数据

$sql="INSERT INTO ".$GLOBALS['ecs']->table('goods_tupian')." (tupian_id,tupian_img,tupian_url,tupian_name)"
." VALUES(null,'$data[tupian_img]','$data[tupian_url]','$data[tupian_nam]')";
$res = $db->query($sql);
if($res){
echo "<script>alert('添加成功');window.history.go(-1)</script>";exit;
}else{
echo "<script>alert('添加失败');window.history.go(-1)</script>";exit;
}

===============================
删除数据
$sql="DELETE FROM ".$GLOBALS['ecs']->table('form_cooperation')." WHERE id=".$id;
$res = $db->query($sql);
if($res){
echo "<script>alert('删除成功');window.history.go(-1)</script>";exit;
}else{
echo "<script>alert('删除失败');window.history.go(-1)</script>";exit;
}
================================
更新数据
$sql="UPDATE ".$GLOBALS['ecs']->table('form_cooperation')." SET status=0 WHERE id=".$id;
echo $sql;exit;
$res = $db->query($sql);
if($res){
echo "<script>alert('删除成功');window.history.go(-1)</script>";exit;
}else{
echo "<script>alert('删除失败');window.history.go(-1)</script>";exit;
}


 






 





==============================

转载于:https://www.cnblogs.com/vip-deng-vip/p/9103543.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值