john666 Posted January 20, 2014 Share Posted January 20, 2014 (edited) i have two tables 1. login and 2nd staff_record both have coulmns like login_id and staff_id i did not mention AUTO INCREAMENT value in login but defined AUTO INCREAMENT in staff_record i want that staff_record AUTO increament value i assign to login_id column value during code execution is it possible ???? because i have columns in login login_id ,user_name, pass_word ,user_level.........and in staff_Record there is emp_id emp_dept_id,emp_name, emp_username, emp_password, emp_level and emp_cnic .... now i want if i update or DELETE record from staff table staff record like user_name and password and user_level that i puted in login table should be updated or delete..PK AND FK concept but i want make this relation through Code is it possible if is then how???? Edited January 20, 2014 by john666 Quote Link to comment Share on other sites More sharing options...
Barand Posted January 20, 2014 Share Posted January 20, 2014 If you already hold the user_name, pass_word and user_level in the staff_record, why would you want to duplicate it in the login records? Quote Link to comment Share on other sites More sharing options...
john666 Posted January 20, 2014 Author Share Posted January 20, 2014 (edited) If you already hold the user_name, pass_word and user_level in the staff_record, why would you want to duplicate it in the login records? i want to make Seprate table for store user login Info..what u suggest its good way or not ??? Edited January 20, 2014 by john666 Quote Link to comment Share on other sites More sharing options...
Barand Posted January 20, 2014 Share Posted January 20, 2014 But all it does it give you problem of maintaining two copies. Which is the reason for your post. Haven't you heard of SQL JOINS? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.