Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it a bad idea to connect two databases like this? How can it be done?
    primarykey
    data
    text
    <p>I am currently using Simple Machines Forum on my website, and users both register AND login using their forum account on my website. The <strong>smf_members</strong> table contains fields such as:</p> <blockquote> <p>id_member | member_name | date_registered</p> </blockquote> <p>What I am trying to do now is extend this to add more custom fields and connectivity on my site. I want to use the id_member field for many things:</p> <p><strong>For example, I want a user (an entry in this smf_members table) to be able to join a team.</strong></p> <p>I am going to create a table <strong>Teams</strong> with the following fields:</p> <blockquote> <p>ID | Name | Description</p> </blockquote> <p>and a table <strong>TeamMembership</strong> with the following fields:</p> <blockquote> <p>UserID | TeamID | Role</p> </blockquote> <p>As you can see, this table will link a member and a team, while leaving data specific to a user or team in their respective tables ONLY (successfully preventing redundant data). This sounds good, right?</p> <p>Well, I don't want those two new tables in the same database as the SMF stuff, because it may get messy. Is it the easiest solution, though? Do you think the easiest solution is to just create my new tables within the same database, with the prefix cst for Custom? I have no idea how to link two databases so if it is too complicated maybe I should just do my cst solution.</p> <blockquote> <p><strong>I've edited this post and have an additional question.</strong></p> </blockquote> <p>Thank you for the answers. I have an additional question. Let's say that I wanted to extend new variables to the members, but again, wanted to avoid adding new fields into the SMF forum member table. What is the easiest way about going about this? Like, I want to create a table called <strong>UsersExtended</strong> and have fields such as:</p> <p>-ID (this is NOT an auto-increment field, but the value of id_member from the SMF members table)</p> <p>-Country</p> <p>Is it easy to create a profile page with this structure and display any relevant data I want from the two tables, in a way, <strong>Linking</strong> the two so that they act as one big table?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload