您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

ESql修改之插入SQLServer数据库记录实例

2024/6/11 14:24:50发布14次查看
一个政府网站维护内容的实例,添加信息 信息编辑页面 主题、顺序及栏目节点 table border=0 cellpadding=0 cellspacing=0 align=center width=96% tr height=30 td 主 题/td tdinput name=subject size=98/td /trchtmlesql module=base id=countselect max(w
一个政府网站维护内容的实例,添加信息
信息编辑页面
主题、顺序及栏目节点


主 题
select max(we_sort) as max1 from site_news where classify=@{ppage:only} 顺 序
引入编辑器(老版,现在已经不在使用,新编辑器请参照)


完整的编辑表单代码(上两部分加起来)

主 题
select max(we_sort) as max1 from site_news where classify=@{ppage:only} 顺 序
提交的脚本
function dosubmit(){ var saves = document.forms['save']; if(saves['subject'].value==) {alert(主题不能空!);saves['subject'].focus();return;} saves['body'].value=gethtml(); if(saves['body'].value==) {alert(内容不能空!);getcompfocus();return;} saves.submit();}
信息保存的页面
判断编辑权限
c0.4.0 ......
修正显示顺序
select min(we_sort) as min1 from site_news where we_sort>=@{ppage:we_sort} and classify='@{ppage:only}'update site_news set we_sort=we_sort+1 where we_sort>=@{ppage:we_sort} and classify='@{ppage:only}'
插入记录
insert into site_news(subject,we_sort,classify,author,ondate,body ) values( @{ppage:subject:string},'@{int:@{ppage:we_sort}+0}','@{ppage:only}','@{session:we_id}',@{sys:date:datetime},@{ppage:body:memo} )
返回列表页

完整的网页代码
c0.4.0select min(we_sort) as min1 from site_news where we_sort>=@{ppage:we_sort} and classify='@{ppage:only}'update site_news set we_sort=we_sort+1 where we_sort>=@{ppage:we_sort} and classify='@{ppage:only}' insert into site_news(subject,we_sort,classify,author,ondate,body ) values( @{ppage:subject:string},'@{int:@{ppage:we_sort}+0}','@{ppage:only}','@{session:we_id}',@{sys:date:datetime},@{ppage:body:memo} )
跟比结构和代码内容都非常类似,只是sql的语法换成了sqlserver,但应用场景却发生了根本变化,轻开平台的优势就是能轻松应对这种变化,很酷吧
轻开平台资源下载及说明
平台免费下载:http://download.csdn.net/detail/tx18/8381859
最新开发手册下载:http://download.csdn.net/detail/tx18/8411089
开发实例:轻开b2c电子商务网站,免费下载:http://download.csdn.net/detail/tx18/8318585
轻开平台会不定期升级为大家提供更多强大而easy的功能,请留意最新的开发手册

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product