zoukankan      html  css  js  c++  java
  • 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;
    }











    ==============================
  • 相关阅读:
    正则表达式的与或非
    正则中需要转义的符号
    HTTP 错误状态码讯息
    HTTP协议详解
    TCP/IP、Http、Socket的区别
    CSS样式中标点符号的作用
    HighCharts: 设置时间图x轴的宽度
    可以尝试用Google Font API来摆脱网页字体的单调 仅仅抛砖引玉
    Oracle 权限(grant、revoke)
    网站加上图标
  • 原文地址:https://www.cnblogs.com/vip-deng-vip/p/9103543.html
Copyright © 2011-2022 走看看