Current location: Hot Scripts Forums » Programming Languages » PHP » php to write data to 2 databases


php to write data to 2 databases

Reply
  #1 (permalink)  
Old 01-02-04, 08:18 PM
mulatod mulatod is offline
New Member
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
php to write data to 2 databases

Hi people

I have a problem.

I have some scripts, and I am trying to implement an UNIQUE LOGIN for all scripts.

NOW I have found a solution for this.

I merge all scripts databases into ONLY ONE... NO SHARED database.
and a main script use for members to register.

When members register to script A, this script copy the user data to the other scripts tables.

My problem?
I think that perhaps it would be better if all databases are independient. and the script send the data to the others databases tables, not to the same DB.

Any solution?

Mulato
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-05-04, 03:28 PM
Stefan's Avatar
Stefan Stefan is offline
Junior Code Guru
 
Join Date: Jun 2003
Location: Utrecht, The Netherlands
Posts: 599
Thanks: 0
Thanked 0 Times in 0 Posts
I don't really understand what you are saying, but I guess you might want to retrieve the userdata from one database, then use mysql_select_db to switch to the other database, and insert the information there.

something like that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 01-05-04, 04:00 PM
jayhawk jayhawk is offline
Newbie Coder
 
Join Date: Dec 2003
Location: Santa Fe, NM
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by mulatod
Hi people

I have a problem.

I have some scripts, and I am trying to implement an UNIQUE LOGIN for all scripts.

NOW I have found a solution for this.

I merge all scripts databases into ONLY ONE... NO SHARED database.
and a main script use for members to register.

When members register to script A, this script copy the user data to the other scripts tables.

My problem?
I think that perhaps it would be better if all databases are independient. and the script send the data to the others databases tables, not to the same DB.

Any solution?

Mulato
I would create your user table as such:

UserID - primary key
userlogin - login name
password - store encrypted either with MD5 or base64_encode
database1 - y/n field to determine if they have access or not
database2 - y/n field to determine if they have access or not

Then when a user logs in you can query to see what databases they have access to and grant them access as needed. You can include all of this in one database as well. Instead of databases replace it with tables.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: check data transfer on certain directories? Agum PHP 7 12-30-03 04:58 AM
php code not pulling data from DB simone PHP 1 11-22-03 03:08 AM
one-page form/catalog in php, data fed in with .csv file? domaky PHP 2 10-25-03 10:32 AM
help plz: format retrieved Mysql data in HTML with PHP paulj000 PHP 2 10-19-03 09:03 PM


All times are GMT -5. The time now is 06:40 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.