online lottery system
Posted by: Yi Wang
Date: May 07, 2008 09:51AM

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!

Yi Wang

Options: ReplyQuote


Subject
Written By
Posted
online lottery system
May 07, 2008 09:51AM
May 09, 2008 09:31AM


Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.