Reply
merging user and password tables.. how?
Old 06-20-2007, 05:40 PM merging user and password tables.. how?
Average Talker

Posts: 19
Name: Haha Why??
Location: Chicago
I'm about to install a system for my site which closely resembles myspace. I need to merge my forum user tables with the myspace login. How can I go about achieving this?

And please don't tell me I have to merge the user tables or edit the login script, I know that! Tell me exactly how and what I need to do
offthaave is offline
Reply With Quote
View Public Profile Visit offthaave's homepage!
 
When You Register, These Ads Go Away!
     
Old 06-20-2007, 05:50 PM Re: merging user and password tables.. how?
Learning Newbie's Avatar
Moderator

Latest Blog Post:
What Does This Look Like?
Posts: 4,727
Name: John Alexander
Uh, if you want step by step instructions, you're going to have to provide a hell of a lot more detail. With what you've said so far, the answer is "Add a column to one of the tables, and write a query to populate it."
__________________
4 ways to improve the lives of the "bottom billion"

"HEY YOU KIDS GET OFF MY LAWN!" -John McCain
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-20-2007, 05:56 PM Re: merging user and password tables.. how?
Average Talker

Posts: 19
Name: Haha Why??
Location: Chicago
ok tell me exactly what you need and I'll provide you with what you need to know. I'm new to all of this
offthaave is offline
Reply With Quote
View Public Profile Visit offthaave's homepage!
 
Old 06-20-2007, 06:36 PM Re: merging user and password tables.. how?
Learning Newbie's Avatar
Moderator

Latest Blog Post:
What Does This Look Like?
Posts: 4,727
Name: John Alexander
What type of database are these tables stored in, what's the schema for the two tables ( if possible, put the DDL create table statements in here ), and what's it should look like when finished? Does it matter which table you new column ends up in?

Is there a particular reason you aren't using a view? Do the two fields need to be written in the same table?
__________________
4 ways to improve the lives of the "bottom billion"

"HEY YOU KIDS GET OFF MY LAWN!" -John McCain
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-20-2007, 07:05 PM Re: merging user and password tables.. how?
Average Talker

Posts: 19
Name: Haha Why??
Location: Chicago
wow, you're talkin in a language I barely know. I want my users to be able to take their forum password and e-mail address and login to the new homepage. I guess I want the myspace login and forum login to be the same table so that when someone registers through the forums or vice versa, the homepage, it automatically makes a user login for the forums and homepage.

it's MySql 5.. ummmm yeah, I can't really provide anymore unless you explain in newb talk lol
offthaave is offline
Reply With Quote
View Public Profile Visit offthaave's homepage!
 
Old 06-20-2007, 07:44 PM Re: merging user and password tables.. how?
Learning Newbie's Avatar
Moderator

Latest Blog Post:
What Does This Look Like?
Posts: 4,727
Name: John Alexander
The problem is that while everybody knows SQL and can tell you the answer to questions that are strictly about that (If I have a field that's null and I, well, something like that), but out of all the members of this forum, only you know how your database is set up.

You're asking for specific instructions on how to make changes to the blueprints, but you're asking people who've never seen the blueprints before. We can tell you all about pens and markers, but we can't tell you which room is which.
__________________
4 ways to improve the lives of the "bottom billion"

"HEY YOU KIDS GET OFF MY LAWN!" -John McCain
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-20-2007, 08:16 PM Re: merging user and password tables.. how?
Average Talker

Posts: 19
Name: Haha Why??
Location: Chicago
^^ True.. how much do you think it would cost someone to do this? Cuz I don't know how to answer unless you break it down which you already have and I still don't get :P
offthaave is offline
Reply With Quote
View Public Profile Visit offthaave's homepage!
 
Old 06-21-2007, 12:15 PM Re: merging user and password tables.. how?
Learning Newbie's Avatar
Moderator

Latest Blog Post:
What Does This Look Like?
Posts: 4,727
Name: John Alexander
It's really not that hard, you shouldn't have to pay for it. Even if you do, you'll still have to deal with tech problems as you get your developer logged into the database. Maybe better to do this yourself?

Let's take a step or two back. What is it you're actually trying to achieve here?

I have a feeling you don't actually have to move the data around. I think a simple query to "see" both pieces ( user name and password ) together is probably all you need. But if you could walk through what you want to happen here people can give you better advice. I tend to take the weekends off from surfing the net, and spend time with the wife, but I can help out today and tomorrow, and there are lots of other bright folks in here.
__________________
4 ways to improve the lives of the "bottom billion"

"HEY YOU KIDS GET OFF MY LAWN!" -John McCain
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-22-2007, 05:29 PM Re: merging user and password tables.. how?
Average Talker

Posts: 19
Name: Haha Why??
Location: Chicago
^ the words you speak are comforting. OK, I want it that the forums user tables are shared with the myspace user tables. So when someone signs up to the forums (www.offthaave.com/forums) the e-mail (or possibly username) and password they enter when they register there can carry over and be able to login here ( sneak peek **********) and vice versa. When someone signs up from the soon to be new homepage, I want them to be able to log into the forums with it...

So that would mean when one signs up through either the soon to be myspace clone or the forums, it automatically makes a universal user that can login to either, using the same info .... get me? Anything else you need to know?

Last edited by offthaave : 07-01-2007 at 07:40 PM.
offthaave is offline
Reply With Quote
View Public Profile Visit offthaave's homepage!
 
Old 06-22-2007, 05:37 PM Re: merging user and password tables.. how?
Learning Newbie's Avatar
Moderator

Latest Blog Post:
What Does This Look Like?
Posts: 4,727
Name: John Alexander
Okay, that makes sense. In your database, it sounds like you have two tables for membership. Do you know what these tables are called, and what fields they have in them?

I'm almost sure MySql 5 supports union queries. Probably the easiest way to accomplish what you want to do would be to write one of these that will list out both of your tables as if they were one big table, and use this query so you have all the information consolidated, but we don't have to actually move records around to different places. We could do that, too, but this may be a little easier, and part of the idea of using a database is to store the data once, and then use queries to look at it in different ways.
__________________
4 ways to improve the lives of the "bottom billion"

"HEY YOU KIDS GET OFF MY LAWN!" -John McCain
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-22-2007, 06:10 PM Re: merging user and password tables.. how?
Average Talker

Posts: 19
Name: Haha Why??
Location: Chicago
well for the myspace login, I believe (by looking at it now) that the fields are:

"otaspace > user"


"offthaav_forums > user"


there is a long list for the forums user table... So does this help or what else do you need?
offthaave is offline
Reply With Quote
View Public Profile Visit offthaave's homepage!
 
Old 06-22-2007, 06:38 PM Re: merging user and password tables.. how?
Learning Newbie's Avatar
Moderator

Latest Blog Post:
What Does This Look Like?
Posts: 4,727
Name: John Alexander
Do you have an interface where you can type (or better yet, paste) in SQL queries and see the results from them?

This is just a for starters, but try running this query - although you may need to edit the table names if I'm reading them wrong?

SELECT userid FROM "otaspace > user"
UNION SELECT user FROM "offthaav_forums > user"

Run that, and have a look at the output. It should automatically filter out any user ID codes that are in both tables, which probably isn't what you want. It does that for distinct row values, not for just one particular field. You can turn that off by saying UNION ALL SELECT blah blah blah. Or just by adding more fields until it's unique.

SELECT userid, password FROM "otaspace > user"
UNION SELECT user, password FROM "offthaav_forums > user"

Then, once you've added in all the fields you could possibly want, either you can save the query as a view in the database, or take all the results from the query and paste them into a brand new table. The UNION will automatically pull and merge the results from both tables into the query output, so then all that's left is to update other parts of your app to refer to whichever table you put the answer into.
__________________
4 ways to improve the lives of the "bottom billion"

"HEY YOU KIDS GET OFF MY LAWN!" -John McCain
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-22-2007, 08:02 PM Re: merging user and password tables.. how?
Average Talker

Posts: 19
Name: Haha Why??
Location: Chicago
wow..... gonna have to read that over a few times to try to see what you're telling me to do hahaha
offthaave is offline
Reply With Quote
View Public Profile Visit offthaave's homepage!
 
Old 07-01-2007, 07:38 PM Re: merging user and password tables.. how?
Average Talker

Posts: 19
Name: Haha Why??
Location: Chicago
alright, I've installed a different service that fits my needs.. www.offthaave.com/testing2 . I tried to search for that line a code you pasted by hitting "Search" up top by "Import" and "Export" and the rest. I got this error.

Quote:
Error

SQL query:
SELECT *
FROM `members`
WHERE SELECT member_id
FROM "avespace > members"
LIMIT 0 , 30
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT member_id FROM "avespace > members"
LIMIT 0, 30' at line 1
oh yeah, with the new service, the tables are different. Instead of "user > userid", it's "members > memberid". What should I do now? Does that matter?
offthaave is offline
Reply With Quote
View Public Profile Visit offthaave's homepage!
 
Old 07-04-2007, 04:31 PM Re: merging user and password tables.. how?
Average Talker

Posts: 19
Name: Haha Why??
Location: Chicago
yeah so no more help? L. Newbie? Anyone? ::Ghost Town:: (tumble weed)
offthaave is offline
Reply With Quote
View Public Profile Visit offthaave's homepage!
 
Old 07-05-2007, 05:16 AM Re: merging user and password tables.. how?
chrishirst's Avatar
Super Moderator

Posts: 11,872
Location: Blackpool. UK
MySql should be

avespace.members
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to merging user and password tables.. how?
 

Thread Tools

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

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




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML