473,761 Members | 5,848 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1582
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********@gma il.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
7911
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 database structure is very simple; just one table with about 15 columns and about 60-75 million rows. There's no need for massaging data or complex relations, just simple searches on maybe a max of 5 columns. Out of the gates we'll be looking at...
60
7300
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 The detector requires javascript 1.0 to work. This translates to netscape 2.0 and IE 3.0 (although maybe IE 2.0 also works with it)
93
2617
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 under consideration for the ANSI C and C++ standards? Are they likely to be accepted into the standards? Which compilers support those types, and which do not?
2
1269
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 to have a label with id=RepeaterCommentText. I then registered the ItemDataBound event to be handled by CommentBound (which has the appropriate parameters). On Comment Entry I change the tags to have square braces (ex. "<b>" to ""). In CommentBind I...
1
1526
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, thanks. Comment c = (Comment) Page.LoadControl("Comment.ascx"); Label time = new Label();
28
7404
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 "good" in such terms, that this core data structure is changed only by atomic operations, so that the data structure is always consistent regarding the application. Only the change-operations on the dicts and lists itself seem to cause problems...
2
2601
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 sqlConn.Open()
6
3943
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 signal to server. This seems to be achievable with body unload events, but it is little too much, as even if user navigate within my site, this event will be generated, this can be avoided by handling onclick of each link, so that I'll know exactly...
1
2948
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 deployed the application to a production server. My Question: How do I create the initial Admin role and user in the clean/unpopulated database that has the Membership and Role schema on this production server?
2
2576
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 popup an alert message and return false. However, if their browser does not support javascript (javascript is turned off) then it just won't send and will give them no reason why. How would I get it so that, using php, if the submit button is...
0
9522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9765
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8770
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.