I am going to implement a user registration system on my website([url]www.sockigami.com[/url]). Please listen: I don’t want any code unless I ask, so you don’t have to waste your time writing code for me. I would just like some input on what some general columns in the database should be. Here’s what I have so far: Email, username, password (encrypted), models submitted, registration time, last login, and points. Is there anything obvious (or not so obvious) I am missing? Thanks for replying!
@DJsACSep 07.2006 — #registration ip address might be useful, in case someone registers with someone elses email address and that person actually wants to do something about it... ?
a status field.
normally set to 1, you can set it to 2 to ban a user or to X to give the user extra (admin for example) rights.
a user rating> other users can rate models submitted. average modelscore gets stored for that user. (say I submitted 4 socks with an average rating of 4.5, my user rating would be 4.5 ? )
first middle lastname... optional.
profile field: user edittable, allows them to add some personal info/signature info to their account.
@chesemonkylomaauthorSep 07.2006 — #Thanks! I actually already had the status thing, I called it activation, but your ideas are great! Did you actually go to the website, because it's not working for me, my connection needs to reset the DNS cache I think.
@chesemonkylomaauthorSep 07.2006 — #For the rating, which I'm also doing for each model, do you think I should have total rating and the number of votes to do that, and then just divide, or an easier way?
@DJsACSep 07.2006 — #Do you think I should actually have the rating column? It's just using the other columns to find the answer?[/QUOTE] Whether you need the column? No.
It depends on how you want to use the code,
*1: If you're displaying the models, do you want the submitters rating to appear?
*2: If your showing submitters profile, do you want individual ratings to appear?
*3: what happens when someone votes?
Rating only in modelstable:
*1 --> you have to recalculate the users rating every time you show a model to every user. Only requires 1 query to retrieve all ratings by user="user" per modelpage.
*2 --> you have to query the membertable for member stats, and query the modeltable for rating stats. Have to recalculate the users rating.
*3 --> vote causes modeltable to be query'd once.
Rating in both tables:
*1 --> you have 2 querys to the database per model, no extra calculation required.
*2 --> you have 1 query to the members table, models table query not required.
*3 --> vote causes both models and members tables to be updated.
@DJsACSep 07.2006 — #No, the math needed to complete that is so easy it shouldn't have any impact on the server.[code=php]function get_rating($votes,$total) { return round(($total/$votes),2); }[/code] ?
Please listen: I don't want any code unless I ask, so you don't have to waste your time writing code for me.[/quote] hehehe :p
@DJsACSep 07.2006 — #I misinterpreted your question the first time...
I'm sorry, it won't happen again.. :eek:
I thought you meant without the rating + votes + total colums in user table, calculate the users rating on every page using stats from the models pages... :rolleyes: