Welcome to our forums...

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.

Forum Statistics

  • Forum Members:
  • Total Threads:
  • Total Posts: 1
There are 1 users currently browsing forums.
PHP Scripting PHP is a scripting language for rapid web-development. It's a popular and powerful, OOP-capable language that is used by professionals. Discuss PHP here.

Reply
  #1  
Old 08-09-2005
Accomplished Graduate Student
 
Join Date: Jul 2005
Location: Cardiff
Age: 22
Posts: 269
Rep Power: 5
Diagmato is on a distinguished road
switching from database to database

For part of a site im doing, there are two options:

1. where theres a username, store the actual username in the field

2. Store the userid, and reference a users table from another database (phpbb).

Im unsure which would be the better option. Whats worse, storing usernames time and time again in a table, or connecting and re-connecting to both databases?

For the second option, i could connect once to phpbb, and once to the sites database. I am closing the mysql link with mysql_close(); after each time a database is finished being used, so theres no case of an un-needed amount of connections.

Another alternative, but im unsure it exists. Whenever theres ANY change to phpbb's user table, it copies it to the sites database. But im not keen on editing phpbb's code at all.

[edit]

Solution:

make a table in the sites database for storing users. In login.php, if the login was successful (checking from the users table in phpbb's database) check the users table on the sites database. If there is a match there, leave it alone. If not, add the user information to it (username, password, user_rank).

If the user changes forum password, it wont match a row in the site database, so it will create a new one. However, it will then delete a previous row with that user id.
__________________
It's Me
if(!$success){$try++;}
else if($success >= 100%){unset($try);}

Last edited by Diagmato; 08-09-2005 at 04:21 PM.
Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Win32 File Switching within a directory hemanth.balaji C and C++ Programming 0 06-10-2005 09:44 AM
Best way to store info in database for a forum? sshum PHP Scripting 6 06-05-2005 03:22 AM
Designing a CD database HombreRana PHP Scripting 10 01-28-2005 02:59 PM
Securing my database BigPete Chit Chat and Hangout 3 01-21-2005 06:31 PM
PHP Database Settings Security eddmun PHP Scripting 5 12-26-2004 12:52 PM