List:General Discussion« Previous MessageNext Message »
From:Yi Wang Date:May 7 2008 4:05pm
Subject:design online lottery system
View as plain text  

I am designing an online lottery system.

There is two-lottery type:
1. The lottery number cannot be repeated (the order is not important),
For example, pick three num in num 1 to 8.
If I selected 235, 546 and 3458(which actually is combination), the
table should like:
|    id (int)     |    num (bit)    |
|     1          |    01101000    |
|     2          |    00011100    |
|     3          |    00111001    |

OK, if I want to select a result for 345, I can use the query:
select * from table where num = num & 00111000;

2. The lottery number can repeat (which order is important). For
example, pick there number to combine to a digit. e.g., 345, not 435
or 543.
This time I really don't know how to design the database. I only to
try is retrieving the data from database to php script, than analyze

I'm not familiar with database design. Could you give me some advice?


Wang Yi
design online lottery systemYi Wang7 May