A strange related question: when the database is queried, one value is missing.

Source: Internet
Author: User
A strange problem is that when we look into the database, there is only one less value, and there is diversity information in the TV, I want to import the new sub-drama content to the database through the introduced Data $ info. during insertion, I interpret it like this. The key value corresponding to $ info is equal to the number of TV sets. If they are equal, the corresponding content is inserted into the diversity field (s_description). The problem arises: During each insertion, the first episode of TV series cannot be inserted. The content of other sets is consistent with the number of sets. when you query the database, there is one less value.
Yes. there is diversity information in the TV. I want to import the new sub-drama content to the database through the introduced Data $ info,
This is how I interpret the data during insertion.

The key value corresponding to $ info is equal to the number of TV sets. If they are equal, the corresponding content is inserted into the diversity field (s_description ).


The problem arises:

During each insertion, the first episode of TV series cannot be inserted.

The content of other sets is consistent with the number of sets.


My code is like this.

PHP code
  While (list ($ key, $ value) = each ($ rs) {// $ rs is the TV series diversity array in the database echo $ value ['s _ num']; foreach ($ info as $ keys =>$ v) {// $ info is an array of diversity content. Echo $ keys ."
"; If ($ value ['s _ num'] = $ keys) {// $ value ['s _ num'] indicates the number of sets. $ option ['table'] = $ this-> module-> getTableName ('Ms _ series_info '); $ option ['data'] ['s _ description'] = $ v; $ option ['where'] [] ='s _ num = '. $ keys; $ option ['where'] [] ='s _ id = '. $ id; $ s = $ this-> module-> update ($ option); if ($ s) {break; }}$ option = '';}}


Note: the initial key value of $ info is 0. I processed it. $ Info corresponds to the initial key word 1 (the processing method is to use the number of sets $ num to correspond to the number of sets $ content .), As the first episode,


Are there any such phenomena?



------ Solution --------------------
Dare not speak with data... The description is too abstract.
------ Solution --------------------
I don't know what framework you are using. print each SQL statement and check it.

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.