This topic is locked
[SOLVED]

 auto insert data

7/22/2010 6:29:34 AM
PHPRunner General questions
P
paulsimo author

Could anybody please help with a problem I have regarding extracting data from 2 tables.

I am trying to build a database that will allow users to complete their details to enter an event. The way I would like it to work is for the user to register their personal details on the database including a username and password (the username would be the primary key). After they have completed the initial registration, on subsequent visits to the database they can simply enter their username and password to log in.

From the log in area, the user has a choice of events to enter, they select the appropriate event and then complete some additional information through a form.

The problem I have is how can I join the registration details table to the events table without the user having to complete the username details in the events table. What I would like is for the username field to be automatically inserted (to enable me to relate the 2 tables) into the events table. Is this possible and how would I go about setting this up.
The registration table would have the following fields:-

first name

surname

username (primary key)

password

email address
The events table would have the following fields:-

event name (primary key)

date of event

arrival time

special requirements

username (auto inserted from users log in details)
The resulting query would need to include all of the above in both tables and would show which events a user has entered. A user would not be allowed to enter the same event more than once.
Many thanks in anticipation.

A
ann 7/22/2010

Hi,
proceed to the Advanced security settings dialog on theSecurity tab and choose Users can see and edit their own data only option, then select username field as OwnerID field.

In this case username field in the events table will be filled automatically with value from users table.

P
paulsimo author 7/24/2010

Hi Ann
Many thanks for that, it works exactly as I wanted it to and with such ease, now I can work on building the database, no doubt I will come across further obstacles, but at least I know there is support there on the forum.

I have just purchased the licence and find the software so much better than any others on the market that I have trialled. Thanks again <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51396&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />



Hi,
proceed to the Advanced security settings dialog on theSecurity tab and choose Users can see and edit their own data only option, then select username field as OwnerID field.

In this case username field in the events table will be filled automatically with value from users table.