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 > associating one field with another

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-28-04, 23:48
jasong jasong is offline
Registered User
 
Join Date: Jul 2004
Posts: 23
associating one field with another

Hey,

I have two very big databases, with two big scripts (forum and shop), and I'm trying to get them to use only one username/password,
So what I'm going to do is move all the tables from one db to the other, and merge the two user tables together.

However, in one table, the fields for username and password are "user" and "pass"
In the other thable, the fields are "username" and "password"

So i can either go through the code of one of the scripts and find every single instance of the word "user" and change it to "username", or there is another way to do it.
Is there?

Is there some way that in the field for "user" i can tell it to go look in the "username" field?
Or any other ways to accomplish this?


Thanks
-Jason G.
Reply With Quote
  #2 (permalink)  
Old 07-30-04, 14:21
yellowmarker yellowmarker is offline
Registered User
 
Join Date: Jul 2004
Location: Dundee, Scotland
Posts: 107
essentially, no, you would need to do code changes to that the applications refer to the correct field name.

in mysql 5.0 with the introduction of views it would be possible but that is not really available for production use yet.

to save doing all those code changes you could do a hack... create the table with the fields user, username, pass, password... then change the application code of both to update all the fields. you'd be duplicating data (storing it in two places istead of one, which is the whole point of a relational database) but it might save effort.
Reply With Quote
Reply

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