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.