Php queries the array of SQL output for help

Source: Internet
Author: User
Tags id3
Php queries the array of SQL output for help I want to explain the result output after SQL query in the form below?
For example, if I query 19 data records
How is the sorting number 2 3 1 3?
Display SQL data 0th ~ with serial number 2 ~ Four serial numbers: 1, 2, 3, 4, and 5
Display SQL data 5th ~ Eight serial numbers: 1, 2, 3, and 4
Show SQL data 9th ~ The 13 serial numbers are 1, 2, 3, 4, and 5.
Display SQL data 14th ~ 16 serial numbers: 1, 2, 3, and 4
Which means
Id = 2
Only 0 ~ p is displayed in id2 ~ Four data entries. these five IDs are respectively 1 2 3 4 5
Id = 3
Only 5 ~ p is displayed in id3 ~ Eight data entries. The four IDs are respectively 1 2 3 4
Id = 1
The p value in id1 is only 9 ~ 13 data records, and the five IDs are respectively 1 2 3 4 5
Id = 3
Only the p in id3 is displayed ~ 16 data records, and the four IDs are respectively 1 2 3 4




Reply to discussion (solution)

I did not understand it after reading it several times.

Yes:
After 18 pieces of data are queried:


  • Data 1

  • Data 2

  • Data 3

  • DATA 4

  • Data 5



  • Data 6

  • Data 7

  • Data 8

  • Data 9



  • Data 10

  • Data 11

  • Data 12

  • Data 13

  • Data 14



  • Data 15

  • Data 16

  • Data 17

  • Data 18


  • How does php output this effect? Pay attention to the id number change ~!

    Can the id be used repeatedly? are you sure it's not a class or something ,,

    IDS cannot be repeated. Second, it is easy to output a two-dimensional array.

    IDS cannot be repeated. Second, it is easy to output a two-dimensional array.
    How can this problem be solved?

    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.