design online lottery system
- Date: Thu, 8 May 2008 00:05:05 +0800
- From: "Yi Wang" <wangyi6854@xxxxxxxxx>
- Subject: design online lottery system
Hi,
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
them.
I'm not familiar with database design. Could you give me some advice?
Thanks!
--
Regards,
Wang Yi
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=royale@xxxxxxxxxx