Problems related to update clicks-php Tutorial

Source: Internet
Author: User
Problems encountered when updating click volume. for example, the above code mainly updates the Click volume, but the result is always 1 when echo & nbsp; $ hits is used, in addition, the hits value in the database is 0. it should be that it is not finally accessed to the database. how should I modify it to update the clicks?



Such as the above code

Updates clicks


However, when echo $ hits is used, the result is always 1 and the hits value in the database is 0;


It should be because the database is not finally accessed. how should I modify it?

Share:


------ Solution --------------------
Reference:
To be honest, I am in touch with PHP because of the need for big jobs. THinkPHP is just getting started. it takes a lot of time and I can only learn what I want, so there are basically no basic skills.


ThinkPHP:

$ User = M ("User"); // instantiate the User object
// Assign values to the attributes of the data object to be modified
$ Data ['name'] = 'thinkphp ';
$ Data ['email '] = 'thinkphp @ gmail.com ';
$ User-> where ('Id = 5')-> save ($ data); // save the modified data according to the conditions.

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.