Number of series generated (1, 2, 3 ... N) Application Examples

Source: Internet
Author: User

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_baseFavorite_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 it

Easy 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

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.