Question2. how can I determine which rule a string conforms to in the data table? Public platform development starts with a course schedule, that is, ^ The course schedule is handled by function1 (of course, this is set in the database, and now it is fixed for example). It starts with 2015, that is, ^ 2015 is processed by function2, complete... question 2. how can I determine which rule a string matches in the data table?
Public platform development,
It starts with a course table, that is, ^ The Course table is processed by function1 (of course, this is set in the database, and now it is fixed for example ),
Starts with 2015, that is, ^ 2015 is processed by function2,
Completely equalRegister
, That is, ^ registration $ is handled by function3.
In the data table
Rule |
Function |
Priority (priority) |
^ Course schedule |
Function1 |
1 |
^ 2015 |
Function2 |
1 |
^ Registration $ |
Function3 |
1 |
...... |
...... |
...... |
How can we get the value to determine which one it corresponds to (assuming that the priority issue is not taken into account )?
Question 1. how to determine a value in a range of a data table
Member table,
ID, USERNAME, PASSWORD, TRUENAME, AVATAR, SCORE, BALANCE, ADD_TIME, REGIP
Level table,
0-is level1
101-500 level2
501-1500 level3
Now we have obtained the user's points, for example, 299. how can we determine if it is level2?
The loop is indeed acceptable. However, the efficiency is not high. This is not fixed by the user.
Reply content: Question 2. how can I determine which rule a string matches in the data table?
Public platform development,
It starts with a course table, that is, ^ The Course table is processed by function1 (of course, this is set in the database, and now it is fixed for example ),
Starts with 2015, that is, ^ 2015 is processed by function2,
Completely equalRegister
, That is, ^ registration $ is handled by function3.
In the data table
Rule |
Function |
Priority (priority) |
^ Course schedule |
Function1 |
1 |
^ 2015 |
Function2 |
1 |
^ Registration $ |
Function3 |
1 |
...... |
...... |
...... |
How can we get the value to determine which one it corresponds to (assuming that the priority issue is not taken into account )?
Question 1. how to determine a value in a range of a data table
Member table,
ID, USERNAME, PASSWORD, TRUENAME, AVATAR, SCORE, BALANCE, ADD_TIME, REGIP
Level table,
0-is level1
101-500 level2
501-1500 level3
Now we have obtained the user's points, for example, 299. how can we determine if it is level2?
The loop is indeed acceptable. However, the efficiency is not high. This is not fixed by the user.
If you have two questions, can you think differently? for example, Question 1
0-is level1
101-500 level2
501-1500 level3
You record the user's point field in the member table. 299 is a value, and then you make a configuration file for these levels, this can be defined by you or handed to the user to define the generated configuration file, which is the level of the configuration file that meets a certain value and does not require additional judgment.
Q1 can be used to create a constant array or configure a config file in the background. after obtaining the information, you can retrieve the level from the array.