html in SQL DB, possible??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
fresh
Forum Contributor
Posts: 259
Joined: Mon Jun 14, 2004 10:39 am
Location: Amerika

html in SQL DB, possible??

Post 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 ;)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
User avatar
fresh
Forum Contributor
Posts: 259
Joined: Mon Jun 14, 2004 10:39 am
Location: Amerika

hey

Post by fresh »

and will make my life easier, for sure... good advice, I'll work on it, thanks phenom... :)
User avatar
PrObLeM
Forum Contributor
Posts: 418
Joined: Sun Mar 07, 2004 2:30 pm
Location: Mesa, AZ
Contact:

Post 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)
User avatar
fresh
Forum Contributor
Posts: 259
Joined: Mon Jun 14, 2004 10:39 am
Location: Amerika

hmm

Post by fresh »

I do once a week, is that often enough, or should I do it more???
Post Reply