PDA

View Full Version : Copying user info into different tables for different programs


RobertSearcy
02-08-2006, 04:07 PM
First of all, I apologize if I'm posting this in the wrong forum. It seems like my issue deals with possibly both PHP and MySQL.

What I'm trying to do is when a user signs up for My portal that I'm creating as part of a redesign project for a webmaster of a TV show fan site (http://grtest.robertsearcy.info/xoops/), their user info (username, password, email address) is copied into the user tables for the chat program that I'd like to implement with the new site (http://grtest.robertsearcy.info/xoops/chat/) and the new image gallery (http://grtest2.robertsearcy.info/gallery2).

When someone registers for Xoops, their info is inserted in the xoops_users table with the following fields: uid, uname, loginname, name, email, user_avatar, pass, rank, and level. What I'd like to have happen is for the Xoops program to also insert the loginname, email, and pass data into another table in the same database called pcpin_user (for the chat) into the login (which is for username), password, and email fields. In addition to that, I'd also like the same type of info to be inserted into the g_userName, g_hashedPassword, and g_email fields on a table called g2_user (for the image gallery).

I'm not concerned about logging in more than once for a different program at this time. I'm only concerned with people being able to use the same username/password combo on the various programs without having to register separately for each one.

BTW, I've already tried the various Xoops "modules" for the specific image gallery and chat programs and they're old and no longer supported.

I've asked people at other places and nobody can seem to give me an answer (nor have they ever asked for more info if they needed any, but I've given all that I thought I needed to give, but if you need more info or whatever, ask me and I'll give ya the extra stuff ya need).

Would anyone know how to integrate the users into the various programs or whatever?

Thanks a bunch in advance!

Brandoe85
02-08-2006, 05:03 PM
Can you have your other applications select from the main users table? Or, you could have multiple insert statements when a new user is created and insert into your other tables, as well.

Good luck;

RobertSearcy
02-08-2006, 06:04 PM
Can you have your other applications select from the main users table? Or, you could have multiple insert statements when a new user is created and insert into your other tables, as well.

Good luck;

I don't know how to get the other applications to use the database tables. If there was an easy way to tell the program to use the Xoops user table, I'd go that route. Is there an easy way of doing that?

I've been looking for those insert statements but can't seem to find them. I'll post in the Xoops forum and ask them where are those insert statements.

Thanks again! :)

raf
02-08-2006, 09:35 PM
i don't realy see the problem.

like Brandoe85 suggests --> have just 3 inserstatements (one to each table) when you add a new user.
an insertstatement is just a standard sql-command that you can embed inside your php-code. anyone with basic php-skills will be able to code it for you in a few minutes...