This topic is locked

Auto populating a field

7/2/2011 3:26:46 AM
PHPRunner General questions
P
paulsimo author

Hi

I am tying myself up in knots trying to figure out what seems like a fairly simple problem. Could anybody please help.

I have a database that contains 2 tables. The first table is a personal profile table, with the fields listed below:-
First name

Surname

username (primary key)

password

email

profile description

date of birth
The second table named "comments" has just 4 fields:-

Name

Comment

username

ID (incremental number and primary key)
What I need is for a user to be able to register their personal profile, to do this they must have to log in (only they will be allowed to add or edit any data put into their own personal profile table.
I then need any other user to be able to add comments into the comments table that would relate to the chosen personal profile table (these users do not have to log in).
I would like a user to be able to select a personal profile from a list and then be able to add their own comment. Ideally I would like it if they do not have to type in the relevant username but that this is auto populated after they select the chosen personal profile.
Is this possible, if so how could I implement this.