If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Binding tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-24-11, 12:55
Calleman Calleman is offline
Registered User
 
Join Date: Feb 2011
Posts: 3
Unhappy 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.
Reply With Quote
  #2 (permalink)  
Old 02-25-11, 04:22
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 623
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
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #3 (permalink)  
Old 02-25-11, 05:40
Calleman Calleman is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 02-25-11, 06:59
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 623
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
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #5 (permalink)  
Old 02-28-11, 18:16
Calleman Calleman is offline
Registered User
 
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?
Reply With Quote
Reply

Tags
bindin, g tables, row, specific

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On