Php Framework-thinkPHP can be easily written?

Source: Internet
Author: User
After reading the tutorial, I have an example of activereocord, but there are too few instances. I just want to find a few more examples by myself. would you like to ask, is this simple or standard? It is to find the data named Huang Moumou, and then add the Chinese score + 1 {code ...} after reading the tutorial, I have an example of activereocord, but there are too few instances. I just want to find a few more examples by myself. would you like to ask, is this simple or standard?

The data called Huang Moumou is searched, and then the Chinese score is + 1

Public function activereocord2 () {$ use = D ('classone'); $ id = $ use-> getByname ('Huang mou') ['id']; $ condition ['id'] = $ id; $ use-> where ($ condition)-> setInc ('China', 1 ); $ this-> oneRow ($ id );}

Reply content:

After reading the tutorial, I have an example of activereocord, but there are too few instances. I just want to find a few more examples by myself. would you like to ask, is this simple or standard?

The data called Huang Moumou is searched, and then the Chinese score is + 1

Public function activereocord2 () {$ use = D ('classone'); $ id = $ use-> getByname ('Huang mou') ['id']; $ condition ['id'] = $ id; $ use-> where ($ condition)-> setInc ('China', 1 ); $ this-> oneRow ($ id );}

$ Use = D ('classone'); $ use-> where (array ('name' => 'yellow XX ')-> setInc ('China', 1 );

Read the manual carefully

Isn't it a result set after get by name? why should I check it again...

The ID is obtained by name, and the ID field is used to modify the field...
Didn't you go around...

It can be done in just one sentence, so we have to avoid so many detours. Write down the SQL statement before using the model syntax.

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.