A certain number of writes are staggered when phpID is similar.

Source: Internet
Author: User
If the phpID is similar, a certain number of data entries are written incorrectly. one table is a seat table and one table is a student table.

Seat table:
ID zid userid

Student table:
Userid cityid


Now I want to randomly write the students in the student table into the seat table. the seat table zid is a two-digit seat number.

For example, there are 20 students in the student table, five of which have the same cityid. if five students with the same cityid have to stagger the five digits in the seat table zid, how can this problem be achieved?

A php program used to schedule the exam aims to prevent students with the same cityid from having similar seats.

Thank you!


Reply to discussion (solution)

Which expert will give you guidance? thank you!

If the five digits are staggered, can they be separated by five or more digits, or can they be separated by four digits?
If it is the former, five students with the same cityid cannot appear in the classrooms of 20 students at the same time.

Thank you for your reply. this is just an assumption that the number of students in the classroom may be 100.

Which expert will give you guidance? thank you!

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.