473,322 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Practical question on user / comment -system.

Hi there

I've built this user management system, using PHP & mySQL, to manage
users that can comment on a certain site. Users have to be logged in to
comment. Below each comment is (how original) the date of
commenting, and the author.

If the user changes his name in his profile, it changes everywhere. So
what i mean is that the user_id is saved together with the comment.
When the comment is pulled out, the query also gets the user's name.

My question:
What is usually done with users deleted from the member system: this
would lead to a blank name on every appearance of a deleted user's
comment.
Or how do i prevent the blank space, and still show the user's name?

Greetigs Frizzle.

Feb 7 '06 #1
6 1565
On Tue, 07 Feb 2006 01:38:34 -0800, frizzle wrote:
Hi there

I've built this user management system, using PHP & mySQL, to manage
users that can comment on a certain site. Users have to be logged in to
comment. Below each comment is (how original) the date of
commenting, and the author.

If the user changes his name in his profile, it changes everywhere. So
what i mean is that the user_id is saved together with the comment.
When the comment is pulled out, the query also gets the user's name.

My question:
What is usually done with users deleted from the member system: this
would lead to a blank name on every appearance of a deleted user's
comment.
Or how do i prevent the blank space, and still show the user's name?

Greetigs Frizzle.


I never change user details, rather I create a new one with a new ID. That
way, you never have that problem, and the quotes stay attributed to the
person who made them at the time. All you need to do is to add a validity
flag to the user details.

$0.02,

Steve

Feb 7 '06 #2
Do you still want to show the deleted user's comment?

Instead of removing the user from the database, you can use a flag
value. You can have a 'status' column that says active or inactive
(1/0), with a default value of active. When the user is deleted from
member system, set the status to inactive.

This way the comment will still show the username. Or you can choose to
just select/display comments from active users.

However, in other places where you need to know whether a certain user
is active (such as user list), you have to do a "select * from
usertable where status=1" so that you're selecting active users only.

I'm not expert. Hope this helps!

Feb 7 '06 #3
Stanch wrote:
Do you still want to show the deleted user's comment?

Instead of removing the user from the database, you can use a flag
value. You can have a 'status' column that says active or inactive
(1/0), with a default value of active. When the user is deleted from
member system, set the status to inactive.

This way the comment will still show the username. Or you can choose to
just select/display comments from active users.

However, in other places where you need to know whether a certain user
is active (such as user list), you have to do a "select * from
usertable where status=1" so that you're selecting active users only.

I'm not expert. Hope this helps!

@Steve
I don't completely understand what you're saying, but i guess it's the
same as Stanches option ... (?)
What i don't get is "$0.02"

@Stanch, that's what i thought of too, but i wasn't too sure of this
method (i use 'deleted = 0/1') was ok, because a deleted user would
still burden the DB.

Thanks.

Frizzle.

Feb 7 '06 #4
Yeap, but I guess that's a minor tradeoff for things to work properly.

Comments showing properly > Huge db. :P

I myself would like to know if there's another way of doing this
without major change to the db structure.

PS: I think $0.02 means "just my two cents". :D

Feb 7 '06 #5
Stanch wrote:
Yeap, but I guess that's a minor tradeoff for things to work properly.

Comments showing properly > Huge db. :P

I myself would like to know if there's another way of doing this
without major change to the db structure.

PS: I think $0.02 means "just my two cents". :D


I'd like to know as well ... :D

$0.0001

Frizzle.

Feb 7 '06 #6
On 2006-02-07, frizzle <ph********@gmail.com> wrote:
Hi there

I've built this user management system, using PHP & mySQL, to manage
users that can comment on a certain site. Users have to be logged in to
comment. Below each comment is (how original) the date of
commenting, and the author.

If the user changes his name in his profile, it changes everywhere. So
what i mean is that the user_id is saved together with the comment.
When the comment is pulled out, the query also gets the user's name.

My question:
What is usually done with users deleted from the member system: this
would lead to a blank name on every appearance of a deleted user's
comment.
Or how do i prevent the blank space, and still show the user's name?


Don't delete the user, mark them as inactive (or historical) instead.

you could do this by addin a boolean field for this info, to the users
table or by putting a certain value in the password field (etc...)

Bye.
Jasen
Feb 8 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ringo | last post by:
Hi all, I'm looking for some ball park estimates on when SQL Server might start to break down, and can't find any reliable info. Any insight is appreciated. Basically, the situation is this: The...
60
by: Fotios | last post by:
Hi guys, I have put together a flexible client-side user agent detector (written in js). I thought that some of you may find it useful. Code is here: http://fotios.cc/software/ua_detect.htm ...
93
by: Matt | last post by:
Hi folks. Can you help with some questions? I gather that some types supported by g++ are nonstandard but have been proposed as standards. Are the long long and unsigned long long types still...
2
by: Ryan Riddell | last post by:
I have a repeater where I output user comments (255 char limit). I want to give the user the ability to add <i>italic</i> and <b>bold</b> font using standard HTML tags. I changed the repeater...
1
by: Green | last post by:
Hi, All I need to dynamically load a user control and change some properties on the user control, and display in the aspx page. Unfortunately I failed, nothing appears. Please help me look at,...
28
by: robert | last post by:
In very rare cases a program crashes (hard to reproduce) : * several threads work on an object tree with dict's etc. in it. Items are added, deleted, iteration over .keys() ... ). The threads are...
2
by: mikeingenito | last post by:
Hello, I have a a web form where i dynamically load a user control. The web page is an issue log, and each user control I add is a specific issue. I load them as follows: Try ...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
1
by: =?Utf-8?B?aGZkZXY=?= | last post by:
Hello, I have a web application that makes use of the SQL Membership and Role providers. My app has admin screens to manage users (membership), roles, and supplementary user data. I have just...
2
by: helraizer1 | last post by:
Hi folks, I have this site and idea http://www.helraizer.co.uk/mychatbox/ at the moment I'm using javascript to alert the user if they haven't entered a username or message but all this does is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.