This topic is locked

register new user and add new data from another table

9/25/2007 08:49:17
PHPRunner General questions
S
sales author

Hello,
I am a newbie and i have a problem trying to add a new user and data for him, from 2 tables.
In my first table i add informations that include username and password necesary for adding a new user.
_users
Name(varchar)

E-mail(varchar)

Username(varchar)

Password(varchar)

Registrationtype(varchar)

ID - autoincrement(int)

UserID - (int)
After the data is added i include a event after record added and i insert a record into another table.
_login

Username(varchar)

Password(varchar)

E-mail(varchar)

Registrationtype(varchar)

ID - autoincrement(int)

UserID(int)
For event i use the following:
global $conn;

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

db_exec($strSQLInsert,$conn);
I have another table from where i insert data also coresponding to user inserted in the first table.
_users1
Age

Phone

Address

Fax
In the security a have selected username and password to taked from table login , fields username and password.
In the advanced security i have selected users can see and edit their own data only. For first table i selected Username for both ownerid's. For login table i selected ID for ownerid's and for user1 table i select UserID for both ownerid's.
When i insert data in the first table, in the login table field username appear blank.
If i change ownerid's in the first table with UserID, username appear correct in the login table and i can use it for login but i can't edit data inserted with this user. I can only view it. And also i can view the other data inserted from the first table but with another username chosen.
If i change in the advanced security users can see other users data; can edit their own data only, i can see and edit all the data inserted with the first table, from any user.
What i need is to insert data in the _users and _users1 table and the user created in the login table from the first table, must to be able to see and edit their own data only.
Please tell me what to do to solve this problem. Thanks in advance !

Alexey admin 9/25/2007

Hi,
you can post your app to Demo account and send a link to it with a problem description to support@xlinesoft.com

I'll try to help you.
The publish on Demo account button is on the last tab in PHPRunner.