Read from Database separated by a comma
Posted: Tue Jan 09, 2007 6:19 pm
Hey Guys,
I have a website, in which a user can choose to predict soccer games every week, but in order for him/her to predict the week, they need to buy it first. I have no problems with the buying part, but the data of the weeks bought should be entered into a database. I have three rows in my data base: username, pass, weeksbought.
Now, I have a page that checks what weeks were paid, it consists of a list that looks like this: (EX.1)
Week 1
Week 2
Week 3
Week 4
etc...
Right next to those values, there will be a word displayed. so say a user bought week 1 and 3 it would do this:
Week 1 Paid
Week 2 Unpaid
Week 3 Paid
Week 4 Unpaid
...
So I need to somehow check with the database whether a week was paid or not. Can the row weeksbought display numbers separated by a comma? something like this?
1,3
If so, How can I read from those weeks into the PHP file that displays what weeks were paid and what weeks were unpaid? (refer to EX. 1)
Thank you sooooo much people.
Yours,
Yuval Karmi
I have a website, in which a user can choose to predict soccer games every week, but in order for him/her to predict the week, they need to buy it first. I have no problems with the buying part, but the data of the weeks bought should be entered into a database. I have three rows in my data base: username, pass, weeksbought.
Now, I have a page that checks what weeks were paid, it consists of a list that looks like this: (EX.1)
Week 1
Week 2
Week 3
Week 4
etc...
Right next to those values, there will be a word displayed. so say a user bought week 1 and 3 it would do this:
Week 1 Paid
Week 2 Unpaid
Week 3 Paid
Week 4 Unpaid
...
So I need to somehow check with the database whether a week was paid or not. Can the row weeksbought display numbers separated by a comma? something like this?
1,3
If so, How can I read from those weeks into the PHP file that displays what weeks were paid and what weeks were unpaid? (refer to EX. 1)
Thank you sooooo much people.
Yours,
Yuval Karmi