• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

mysql 搞代码 4年前 (2022-01-09) 21次浏览 已收录 0个评论

一个政府网站维护内容的实例,添加信息 信息编辑页面 主题、顺序及栏目节点 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

一个政府网站维护内容的实例,添加信息

信息编辑页面

主题、顺序及栏目节点

<table border="0" cellpadding="0" cellspacing="0" align="center" width="96%">      <tr>        <td> 主 题</td>        <td></td>	  </tr>Select max(WE_SORT) as max1 from SITE_NEWS where CLASSIFY=@{pPage:only}      <tr>        <td> 顺 序</td>        <td></td>	  </tr>      <tr>        <td> </td>        <td></td>	  </tr>    </table>

引入编辑器(老版,现在已经不在使用,新编辑器请参照)

<table border="0" cellpadding="0" cellspacing="0" width="96%" align="center">	<textarea name="BODY"></textarea>      <tr>        <td>					</td>      </tr>    </table>

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

<br><!---ecms -ecms  信息表单 -->		<table border="0" cellpadding="0" cellspacing="0" align="center" width="96%">      <tr>        <td> 主 题</td>        <td></td>	  </tr>Select max(WE_SORT) as max1 from SITE_NEWS where CLASSIFY=@{pPage:only}      <tr>        <td> 顺 序</td>        <td></td>	  </tr>      <tr>        <td> </td>        <td></td>	  </tr>    </table>	<table border="0" cellpadding="0" cellspacing="0" width="96%" align="center">	<textarea name="BODY"></textarea>      <tr>        <td>					</td>      </tr>    </table>	

提交的脚本

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<!---ecms -ecms  栏目节点 --><!---ecms -ecms  引入权限检查文件 --><!---ecms -ecms  权限判断 -->			......		<script>alert("您没有权限!");history.back();</script>

修正显示顺序

		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}			)		

返回列表页

<script>location.href='@{sys:face}@{sys:curPath}list.html?n=@{pPage:n}&#39<a style="color:transparent">本文来源gao($daima.com搞@代@#码(网5</a>;;</script>

完整的网页代码

c0.4.0<!---ecms -ecms  栏目节点 --><!---ecms -ecms  引入权限检查文件 --><!---ecms -ecms  权限判断 -->			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}			)				<script>alert("您没有权限!");history.back();</script><script>location.href='@{sys:face}@{sys:curPath}list.html?n=@{pPage:n}';</script>

跟比结构和代码内容都非常类似,只是SQL的语法换成了SQLServer,但应用场景却发生了根本变化,轻开平台的优势就是能轻松应对这种变化,很酷吧

轻开平台资源下载及说明

<p>平台免费下载:http://download.gaodaima.com/detail/tx18/8381859</p><p>最新开发手册下载:http://download.gaodaima.com/detail/tx18/8411089</p><p>开发实例:<strong>轻开B2C电子商务网站</strong>,免费下载:http://download.gaodaima.com/detail/tx18/8318585</p><p>轻开平台会不定期升级为大家提供更多强大而Easy的功能,请留意最新的<strong>开发手册</strong></p>

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:ESql修改之插入SQLServer数据库记录实例

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址