Results 1 to 5 of 5

Thread: Binding tables

  1. #1
    Join Date
    Feb 2011
    Posts
    3

    Unhappy Unanswered: Binding tables

    Hi all!

    I'm very new to all this sql, but what a world!

    I'm trying to create a webform for a club. This is what I want it to do:
    Register as member
    Add personal details about yourself, such as allergies.

    Register for an event and have the database send an automated notification about who has signed up.

    I've managed to get the register form and login form to work, but now I want the logged in user to be able to update their personal details, like phone number and address.
    In my world that means that I would have to bind a table (containing the user data) to another table (containing the users log in details) so that just the logged in person can see and edit his/her details.

    I'm using Visual Studio 2010.

    Please hint me in the right direction.

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    You will need to provide more information. I assume that you have a login table which contains a loginid and username and password. You also have a separate table containing the personal information. Is this correct? Do you know the loginid of the person you are connecting with? Does you personal information table contains the loginid?
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  3. #3
    Join Date
    Feb 2011
    Posts
    3
    Quote Originally Posted by it-iss.com View Post
    You will need to provide more information. I assume that you have a login table which contains a loginid and username and password. You also have a separate table containing the personal information. Is this correct? Do you know the loginid of the person you are connecting with? Does you personal information table contains the loginid?
    I have built my site with the "all-ready-made" login and register forms, so there is one table holding that information and then I've made a table inside the same database. So you were correct in your assumption
    I don't know the loginId of the person.
    I thought you could refer to it like this "If this logged in person has id=1 then show id=1 in USERSDATA"

    But I would of course like to have it displaying the specific information for the logged in person.

  4. #4
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Unfortunately that is not possible. The database does not know the login id of the person who has logged in. If you find this then you will be able to access your personal details information using this value. Is the development being done in PHP? If yes, it is quite likely that the information will be stored in the $_SESSION array somewhere. Once you have that you can use this to both get the personal information and also to update them in the database. The update would be something like:

    Code:
    UPDATE personal_information SET name = '$name', address = '$address' WHERE loginid = $loginid
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  5. #5
    Join Date
    Feb 2011
    Posts
    3
    Okey.
    Maybe it would be easier to add some textfields in the Register-User-Wizard and bind it with the same table? (If that is possible?)

    Because then the database would have all the information about a user stored in the same row.

    Do you recon that's a posibility?

Tags for this Thread

Posting Permissions

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