• 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;
    }











    ==============================
  • 相关阅读:
    HDU 1686 Oulipo(kmp)
    openstack介绍以及流程
    openstack组件介绍
    linux之sort
    linux-ls命令
    CSRF-跨域访问保护
    WEB聊天
    python之路-Django进阶
    python之路-Django
    python之路-jQuery
  • 原文地址:https://www.cnblogs.com/vip-deng-vip/p/9103543.html
Copyright © 2020-2023  润新知