Ask a very tangled question

Source: Internet
Author: User
My database is mysql, and the sale table has an hit column, the hit column is used to store user clicks. if the initial value of hit in the sale table is 10 $ num =, the value of the hit column in the sale table is 10, so far no problem $ num + = 1; // at this time, the output value of $ num is 11, and there is no problem.
My database is mysql. there is an hit column in the sale table. the hit column is used to store user clicks.

Assume that the initial hit value in the sale table is 10.

$ Num = the value of the hit column in the sale table is 10, so far no problem
$ Num + = 1; // The output value of $ num is 11 at this time.
Mysql_Query ("Update 'sele' set hit = '{$ num} 'Where id =' {$ id }'"); // An error occurs here. after you open the database, you will find that the hit value is 12, and it should be 11.

Note: the program code is absolutely correct. I use the same code to operate the news Table. everything works normally.
An error occurs only when the update operation is performed on this sale table. Therefore, it may be caused by a problem with this sale table or a mysql bug. please kindly advise !!!


The structure of the sale table is as follows:
Create table 'sele '(
'Id' mediumint (9) not null auto_increment,
'Uid' mediumint (9) not null default '0' comment' issuer id, corresponding to user ',
'CID' mediumint (9) not null default '0' COMMENT 'sub-class id, corresponding to class ',
'Tid' mediumint (9) not null default '0' comment' city, corresponding to the key value of cache_town ',
'Typ' tinyint (2) not null default '2' COMMENT: test Arr (1 )',
'Btyp' varchar (50) not null default '1' comment' transaction type: 1 warranty transaction; 2 private transaction ',
'Styp' varchar (50) default NULL comment' shipping method. separate and package the hint, such as:, 1, 2 ,',
'Title' varchar (200) default NULL comment' topic ',
'Price' int (11) default '0' comment' COMMENT lattice: 0 COMMENT agents ',
'Mess' varchar (2000) default NULL comment' internal volume ',
'IMG 'varchar (500) default NULL Comment' The number of route entries and the name of the route entry (excluding the root route entry @ up) are separated ',
'User' varchar (10) default NULL comment' COMMENT author ',
'Tel 'varchar (50) default NULL comment' phone number or cell phone number ',
'Jishi' tinyint (2) default '1' comment' is a time-passed type ',
'Jishi1' varchar (50) default NULL comment' refers to the timeout parameter that is passed ',
'Hit' mediumint (9) default '0' comment' vertex quota Times ',
'Ord 'mediumint (9) default '0' COMMENT 'sort value ',
'Time' int (9) default '0' comment' added time ',
Primary key ('id ')
) ENGINE = InnoDB AUTO_INCREMENT = 35 default charset = utf8;

------ Solution --------------------
Http://wenku.baidu.com/view/2fa7761dc281e53a5802fff2.html
------ Solution --------------------
What is the situation? Is your statistical address automatically accessed?

Discussion

Okay, I have solved the problem because

Okay, now that the problem has been solved, who can help me find a mongoDB Chinese user manual and who will get the score.

------ Solution --------------------
PDF, http://ishare.iask.sina.com.cn/f/20149547.html? F

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.