Session or table

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
epic
Forum Newbie
Posts: 9
Joined: Sun Jun 02, 2002 6:14 am

Session or table

Post by epic »

i am trying to create a members area for my site. i want it so when a user logs into the members area they are given some of there basic information about there account.
Would i be better setting up a table in my mysql database where they can log on and i would just echo there information onto the page.
To go into more detail im setting up a new webhost. In the members area i want there to be a little account information box which will display the domain or subdomain where there site can be found. there username, mysql username.
I was originally using .htaccess but i decided that i wanted something more user specific.
can any suggest what i should do and / or an easy way to do it.
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

the best way i can think of it is to use sessions, make a mysql table for users and have all the information about users in it then echo whatever you need.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Somethings to consider.....

Post by BDKR »

The MySQL db you are talking about. Is it the same db that users would use for their accounts? What if the database goes down? Not only will users sites (those using mysql at least) start mis-behaving, but when they need to contact you to complain, they won't be able to login to the system.

Speed really isn't as a big an issue here if you are just providing a client with information regarding his/her account. That said, perhaps loging in against a file or file based db may be a better idea. It's a lot less likely to go away then a mysqld process is to crash! :-) And easier to back up too.

However, if you do decide to use MySQL, make sure you also have a second machine running MySQL and replicating from the first. That way, if your db goes away, you can fall back on the secondary box.

Later on and good luck,
Big Din K.R.
rats
Forum Newbie
Posts: 21
Joined: Fri May 31, 2002 5:55 am

Post by rats »

phpbuilder has an article and code for a user authentication system

http://www.phpbuilder.com/columns/tim20000505.php3
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Re: Somethings to consider.....

Post by mikeq »

BDKR wrote:The MySQL db you are talking about. Is it the same db that users would use for their accounts? What if the database goes down? Not only will users sites (those using mysql at least) start mis-behaving, but when they need to contact you to complain, they won't be able to login to the system.

Speed really isn't as a big an issue here if you are just providing a client with information regarding his/her account. That said, perhaps loging in against a file or file based db may be a better idea. It's a lot less likely to go away then a mysqld process is to crash! :-) And easier to back up too.

However, if you do decide to use MySQL, make sure you also have a second machine running MySQL and replicating from the first. That way, if your db goes away, you can fall back on the secondary box.

Later on and good luck,
Big Din K.R.
Dependent on how critical the availability of the application is.

Maybe you should have a second webserver standing by incase the primary webserver goes down :wink:

In my opinion if you have MySQL available use it. How easy is it to perform searches and queries on "file based" compared to MySQL (and I am talking performance and coding).

I have 4 different webservers running all with MySQL databases and never had any problems with MySQL.
Post Reply