Take the series number @{sn:favorite}, put in the bag doc
<bag Id=doc><we name=we_id>@{sn:favorite}</we></bag>
If the number of series@{doc:we_id}Is null, the maximum value of the primary key we_id field of the Favorite_base table is queried for initialization.@{sn:favorite=
@{pk:favorite_id}}Number of series
<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>
Insert the system number and the related content separately
Favorite_base、
Favorite_userIn the table
<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>
Full code
File (blog_add_save.chtml) in the Site/blog directory of e-commerce Web sites, combine relevant documents to actually experience itEasy to download resources for Internet development Platform
Platform and Latest development Manuals free Download: http://download.csdn.net/detail/tx18/8464425
Development example: Light Open e-commerce website , free download: http://download.csdn.net/detail/tx18/8318585
Light open platform will be upgraded to provide you with more powerful and easy features, please pay attention to Download the latest version
Number of series generated (1, 2, 3 ... N) Application Examples