ecshop 輸出數組

找到include/cls_template.php文件 
找到get_val()函數,能夠在大約629行加入php

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

在模板裏面能夠用{$p|print_r}在循環數組的時候打印出數組數據sql

==================================================數組

$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;oop

==================================================url

 

 

 

=============================3d

添加數據orm

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


 






 

==============================
相關文章
相關標籤/搜索