"The situation is as follows"
Recorded in table 1
Bicycle number tenant Merchant
1 a 2 a3 b4 c
[Here's the meaning of the different merchant.] Owned bicycles, merchants own bicycle tables]
Table 2
Bike number rent out time rent out amount
1 2 41 3 51 6 102 3 53 4 7
[This means that. Different merchant on their own bike rental time different set price, bicycle Price table]
Table 3
Bike number rent out time rent the person
1 2 用户11 3 用户22 4 用户33 2 用户44 1 用户5[这里指,用户,在今天使用的自行车和租的时间,租车记录]
"Then the problem comes."
I want to know now.
1, Business today car rental, with 1 cars, total number of car rental
Finally to get
Bike Number Rented 2 hours a few times? How many times do you rent out 3 hours? How many times do you rent out 4 hours?
I have 2 different ways. The first is to use the program to find out the rental records of all cars. And then in the program to use the statistics to rent out the time, and how many times.
Ask this type of data statistics. How PHP is generally achieved can take into account efficiency. can be very concise again!
Reply content:
"The situation is as follows"
Recorded in table 1
Bicycle number tenant Merchant
1 a 2 a3 b4 c
[Here's the meaning of the different merchant.] Owned bicycles, merchants own bicycle tables]
Table 2
Bike number rent out time rent out amount
1 2 41 3 51 6 102 3 53 4 7
[This means that. Different merchant on their own bike rental time different set price, bicycle Price table]
Table 3
Bike number rent out time rent the person
1 2 用户11 3 用户22 4 用户33 2 用户44 1 用户5[这里指,用户,在今天使用的自行车和租的时间,租车记录]
"Then the problem comes."
I want to know now.
1, Business today car rental, with 1 cars, total number of car rental
Finally to get
Bike Number Rented 2 hours a few times? How many times do you rent out 3 hours? How many times do you rent out 4 hours?
I have 2 different ways. The first is to use the program to find out the rental records of all cars. And then in the program to use the statistics to rent out the time, and how many times.
Ask this type of data statistics. How PHP is generally achieved can take into account efficiency. can be very concise again!
This directly can be solved with SQL statements, with left join can find out any of the data you want, if you use PHP processing, once all the data are taken out, and then processing is also possible, do not cycle to query the database.