This topic is locked

insert record for a specify user

9/20/2007 8:13:00 AM
PHPRunner General questions
L
luck author

Hi,
I have 2 table. One for user data and one for login informations.
The first table is _candidates with the following fields:
Username

Password

Email

Firstname

Lastname

Adress

Phone

ID
The second table is _login with the following fields:
Username

Password

Email

Activateprofile

ID
I want when i enter the data in the first table and i update the similar fields in table login (Username, Password, Email) from the first table, the user created, when i login with data updated, from the login table, to have access to edit and see only the data completed from the first table.
In this moment when i insert data in the first table and make the user with the information provided here, when i login with this user i can't see the data completed with this username.
I think i need a way to make a link between the data from the first table and the user created with this information in the second table.
Please give me a sollution for this issue.
Thank you!

Alexey admin 9/20/2007

Unfortunatelly I wasn't able to understand what are you trying to do.
Please try to rephrase your question.

L
luck author 9/20/2007

Unfortunatelly I wasn't able to understand what are you trying to do.

Please try to rephrase your question.


Hi,
I have a form for users. This form is based on table _candidates. When i input the data in this form i save the information in table candidates and also save the information from fields username, password and email to table login in fields username, password, email. The second table(login) contain information for security(username, password). After i input this data the result was to create a username in table login who has information in table candidates, but if i login with this username i can't edit this informations. It seems like is not created or input by this user and i want this data to see like is created by user input in the first table.

Alexey admin 9/20/2007

...and also save the information from fields username, password and email to table login in fields username, password, email...

How do you save it? Add a new record or save in some existing ?

..but if i login with this username i can't edit this informations ...



What do you mean by "can't edit" ? Do you use some advanced security set up ? Describe this in detail.

L
luck author 9/20/2007

How do you save it? Add a new record or save in some existing ?

I use event for table _candidates: After record added
global $conn;

$strSQLInsert = "insert into _login (Username, Password, Email) values ('".$values["Username"]."','".$values["Password"]."','".$values["Email"]."')";

db_exec($strSQLInsert,$conn);
What do you mean by "can't edit" ? Do you use some advanced security set up ? Describe this in detail.


I mean i can see the data but it is not like curent user inserted this data. In security - advanced i have setup user can see and edit their own data only. And this is what i want: to see and edit only the data input in the first table for each user.
Example:
Candidates
Username:John
Password:John
Email:j@y.com
Firstname:John
Lastname:John
The data is send to login
Username: John
Password: John
And after i login with username and password John i want to see and edit the data from the first table.
Thank you!

Alexey admin 9/21/2007

Hi,
proceed to Advanced Security dialog, select Candidates table and choose Usernamein both OwnerID boxes.

L
luck author 9/21/2007

Hi,

proceed to Advanced Security dialog, select Candidates table and choose Usernamein both OwnerID boxes.


Hi,
I did the modification like you write previous, but now, on the table login, information for username is null. Please tell me what to do next.
I input the data on the first table candidates.
Username: Place
Password: Place
E-mail: place@m.com
.......
And on the second table login the data apears like that:
Username:
Password: Place
E-mail:palce@m.com
Thank you for your support and hope you can help me resolve this issue.

Alexey admin 9/21/2007

Hi,
publish your project on Demo account and send a link to it to support@xlinesoft.com

Include instructions on reproducing the problem.