Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Banned
    Join Date
    Aug 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Please Help me in PHP Coding

    how can I give foreign key relation?

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,166
    Thanks
    23
    Thanked 601 Times in 600 Posts
    I'm guessing here.
    A foreign key relates to the primary key in a different table. It's used to link the two.
    An example:
    Your user database stores information about your customers like name, email, password and should have a primary key ID number to identify the user. When he/she logs in you get this id and use it instead of a name.

    Now the second table maybe a team the user belongs to, a list of work assignments for them, any thing that relates to a user. This is the foreign key resides and when you write the order or the assignment to this table you insert the user id in the foreign key column to link them.

    Hope this helps.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •