ESQL modified insert MySQL database record instance

Source: Internet
Author: User

An information site maintains instances of personal content and adds information

Information editing page

Introducing Editor Scripts

<script type= "Text/javascript" src= "@{sys:path}fckeditor/fckeditor.js" ></script><body leftMargin=0 Topmargin=0 marginwidth= "0" marginheight= "0" onload= "SHOWFCK ()" >
Information Title and content editor
<table class=border cellspacing=0 cellpadding=0 width= "98%" Align=center border=0> <form action= "@{sys : face}@{sys:curpath}blog_add_save.chtml "method=" POST "id=" save "><tr><td align=center height=24 noWrap >  <b> Mark   Title </b> </td><td><input name= "title" Size=98></td ></TR><TR> <td align=center height=24 valign= "Top" Colspan=2><textarea name=content style= " Display:none "></textarea><script type=" Text/javascript ">function ShowFCK () {var sBasePath =" @{sys: path}fckeditor/"; var ofckeditor = new FCKeditor (' content '); ofckeditor.basepath= sbasepath; ofckeditor.height=; OFC Keditor.value= '; Ofckeditor.replacetextarea ();} </script> </td></tr><input type= "hidden" value= "@{ppage:n}" name= "n" > </form> &LT;TR&G T;&LT;TD height= "colspan=2 align=center><a href=" Javascript:dosubmit (); id=mysubmit1>[Submit]</a> <div id=mywait1style= "Display:none" > is being submitted, please wait ...</div></td> </tr></TABLE> 
Script for submitting information
function Dosubmit () {var saves = document.forms[' save '];if (saves[' title '].value== ' ") {alert (" title cannot be empty! "); saves[' title '].focus (); return;} var oeditor = fckeditorapi.getinstance (' content '), var ODOM = Oeditor.editordocument;var des;if (document.all)//IF Internet explorer.des = oeditor.editordocument.body.innertext;else{//If Gecko.var r = Odom.createrange (); R.selectnodecontents (odom.body);d es = r.tostring ();} if (des== "") {alert ("The content cannot be empty!") "); return;} Saves.submit (); Mysubmit.style.display= "None"; mywait.style.display= "Block"; Mysubmit1.style.display= "None"; mywait1.style.display= "Block";}
Show

page where information is saved

Determine login

<if x= "@{session:user_id}" Else=1><script>alert ("Please login first! "); top.location.href=" @{sys:path} ";</script><we>...</we></if>
Take ID

<bag id=doc><we name=we_id>@{sn:favorite}</we></bag><if x= "@{doc:we_id}" ><we> <esql module=base id=pk commit=true>select Max (we_id) as favorite_id from Favorite_base</esql><bag id= Doc><we Name=we_id>@{sn:[email protected]{pk:favorite_id}}</we></bag></we></if>
Chinese participle

<!--participle--><call>doc2words</call>...<chtml file= "htm/doc2words.htm" Onlycall id=doc2words/>
Inserting information
<esql module=base Act=edit Commit=true>insert into Favorite_base (we_id,title,words,content,words_content) Values (@{doc:we_id:int},@{ppage:title:string},@{ppage:words:string},@{ppage:content:memo},@{ppage:words_ Content:memo}) </esql><bag id=ppage><we name=content1>@{intleft:@{ppage:content1} (580)}</we ></bag><esql module=base Act=edit>insert into Favorite_user (F_id,author,tree_id,ondate,memo) Values ( ' @{doc:we_id} ', ' @{session:user_id} ', ' @{ppage:n} ', ' @{sys:date} ', @{ppage:content1:memo}) </ESql>
Back to List page
<to>@{sys:path}@{sys:curpath}[email Protected]{ppage:n}&[email protected]{session:user_id}</to>
Full page code
List effects after saving

This part of the code ise-commerce Web site with light openingIn the Site\blog directory, quickly open to try it!


Download and description of light-open platform resources

Platform Free Download: http://download.csdn.net/detail/tx18/8381859

Latest Development Manual Download: http://download.csdn.net/detail/tx18/8411089

Development example: Light Open e-commerce website , free download: http://download.csdn.net/detail/tx18/8318585

The light-open platform will be upgraded to provide you with more powerful and easy features, please note the latest development manuals



ESQL modified insert MySQL database record instance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.