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