![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: May 2006
Posts: 21
Rep Power: 0
![]() |
Virtual pet site MySQL question
I have a question about making a virtual pet site (you probably don't need any virtual pet site-making experience to answer it, though). My question is would I make the amount of spending points the user has part of a MySQL database and update it everytime they earn more, buy something, etc. or would I do it a different way? Thank you for taking the time to read my newbish question.
![]() |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3
![]() |
i would actually set up a timer to update every time or just to update everyone every second if thats what you are talking about but i dont clearly understand tottally what you are talking about tho
|
|
|
|
|
|
#3 |
|
Expert Programmer
|
Everytime the user log on, record the time into the Mysql DB. Then, everytime the session refreshes, record the time, and compare it to the record you have. Calaculate the difference and assign the correct number of points or money or w/e.
That is how it's done most of the time.@Razr - Good idea, but it won't work with PHP and MySQL. It would only work with application programming ![]() |
|
|
|
|
|
#4 |
|
Newbie
Join Date: May 2006
Posts: 21
Rep Power: 0
![]() |
I never thought of doing that, Booooze. How would I do it, though? I just started programming in PHP yesterday so I have no clue.
|
|
|
|
|
|
#5 | |
|
Expert Programmer
|
Quote:
For a start, figure out how to display the time in PHP. I'd start by simply writing to a text file. Once you have that, get the ability to read it as well, and display it on the page. At the same time, write the current time. At this point you should have 2 times. Then try and compare the too. Unfortunatley I can't remember how to do it, so simply google it, and see what you can come up with. Onc eyou have taht, look up a cookies and sessions tutorial. Then post back. gtg |
|
|
|
|
|
|
#6 |
|
Expert Programmer
|
Good Links:
http://www.highlystructured.com/comp...dates_php.html http://ca.php.net/date Bookmark php.net, if you havent already php.net has the whole manual to php if you didn't know that. Have fun![]() |
|
|
|
|
|
#7 |
|
Newbie
Join Date: May 2006
Posts: 21
Rep Power: 0
![]() |
Thanks for the links Booooze.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|