Answer the question
In order to leave comments, you need to log in
What is the database structure for authorization via email / password and social. networks?
The site now has the ability to register and log in via email / password (standard login and registration form). In general, all data from the social. I get networks, this is id, email, name, and the provider itself (google, facebook, etc.). Now the task arose of how to finalize the structure of the database so that you can register users through social networks, plus the ability to "link" all these social accounts into one in the profile.
For example, a user has already registered with one email and then logged out of the account. He has a social media account. networks with registration through the same email. Now, if the user decides to enter the site from this social. account, then he gets into his account that he created earlier (the email is the same) or is it a different account?
Secondly, if, for example, the third social account is registered to another email, is this another account? or in the profile, he decided to link this social account to the account, add a field in the database with, for example, an additional field email2?
And another question if, for example, the user does not have an email in the social account (registered via phone), how to register it? In general, advice is needed, any examples?
Answer the question
In order to leave comments, you need to log in
Now the task arose of how to refine the structure of the database so that you can register users through social networks, plus the ability to "link" all these social accounts into one in the profile.
And another question if, for example, the user does not have an email in the social account (registered via phone), how to register it? In general, advice is needed, any examples?Not that it is not, but some APIs simply do not give it. Here, either require the user to specify an E-mail, or allow the creation of users with an empty E-mail.
Well, wardump, so there is a difference.
The only trouble is with the logic...
First: if($row['name'] == $select)
Something that basically doesn't match gets into else, why do you have EXACTLY THE SAME CHECK there again, it will never return a match.
The horror is terrible.
Why read all the rows from the database if you are only interested in the presence of one key in it?
Why ask for all fields if you only need one?
Why use mysql_ functions if they are no longer supported in new versions of PHP?
Why substitute data in a query without any protection against SQL injection?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question