PeterBubresko Posted July 8, 2023 Share Posted July 8, 2023 I am in the process of putting together a system where I include a MySQL database. In this I have table user which contains username in the form of an email address, and the password. The page includes a good deal of user information, therefore passwords and usernames are separated to only be in the users table. The other user information I need, but which is kept away from the users table, is the user_inf table. Is it possible to somehow connect these two tables together? so that I can still retrieve the user information where I want/need? This has something to do with the fact that I need the user's e-mail address elsewhere together with the information in the user_inf table, yes also..... argh, forget it. Is there a solution so that my users do not need to register their e-mail address in two places in the registration form in order to save it in two different tables? Primary key is ID . Quote Link to comment https://forums.phpfreaks.com/topic/317067-connect-two-tables/ Share on other sites More sharing options...
Barand Posted July 8, 2023 Share Posted July 8, 2023 7 minutes ago, PeterBubresko said: Is there a solution so that my users do not need to register their e-mail address in two places Indeed there is. In fact the email address should not be in two places. The only item that would appear in more than one table is the ID. Just JOIN the tables on the user_id when you need info from both tables. Quote Link to comment https://forums.phpfreaks.com/topic/317067-connect-two-tables/#findComment-1610371 Share on other sites More sharing options...
PeterBubresko Posted July 8, 2023 Author Share Posted July 8, 2023 I Didn't understand anything. Too many choices to choose between behind the link. I find it out by myself. I know what to look for now. Thanks any way Quote Link to comment https://forums.phpfreaks.com/topic/317067-connect-two-tables/#findComment-1610380 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.