Page 1 of 1

html in SQL DB, possible??

Posted: Mon Jul 12, 2004 10:06 pm
by fresh
Hey,

I got a scheme for my users accounts and point system, using folders, and php, which generates there points, which is read and printed to there page, when ever they login or pass a mission...

ex:

- user logs in
- account page is generated and sent to there folder which is also generated at login, overwritting the one already there wether they exists or not...
- if the user completes a mission, their points are written to an html page which is also generated at login and included in their generated folder as well as their accounts page and the points page is then read and the value of the points page is then printed inside there accounts page.

thus a self updating account and points scheme... however, this is not a perfect world and nothing works like it should, the first, second or third time, so sometimes the user gets the folder with the two files inside, and sometimes they get nothing... this is not going to work obviously, so I would like to do this with SQL now, so can I throw there generated files, minus the folder, in a row??? and have them updated when they login and complete a mission???

How, would you go about doing this??


thanks

p.s. should make better sense now ;)

Posted: Mon Jul 12, 2004 11:26 pm
by John Cartwright
I would recommend doing something like this

user.php && database.users
1.They register and a new row is created on the table users.
2. They login and a session is created

mission.php
I dont know what missions you speak of but do something liek this:

1. Check if the logged in session exists
2. Once they complete their mission send them to process.php with all the point variables created in mission.php

process.php
1. check if the logged in session exists
2. update their account information with the newly acquired points.

display.php
1. "select * FROM `user` where id='$userid'"
2. Display their information accordly to that sql query.



In the end this will save you the trouble of having several files for each user.

hey

Posted: Mon Jul 12, 2004 11:44 pm
by fresh
and will make my life easier, for sure... good advice, I'll work on it, thanks phenom... :)

Posted: Mon Jul 12, 2004 11:48 pm
by PrObLeM
caution: make sure you back the db's up regularly because if something happends and it goes down your going to have a lot of angry people on your hands :D (i of course am talking from experience, luckly i had a backup and i was the only user because it was in development)

hmm

Posted: Mon Jul 12, 2004 11:49 pm
by fresh
I do once a week, is that often enough, or should I do it more???