K
K
kiril90112017-10-15 13:53:53
PHP
kiril9011, 2017-10-15 13:53:53

How to make a connection between a table in a database?

Hello! I have a registration on the PHP and MYSQL site, I created a table in the users database, the registration is fine, I have a question: How to bind to the login of the information that the client will enter into the database in his account? Most likely you need to make a connection between tables, but how to do it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir, 2017-10-15
@djQuery

Yes, create at least one more table, for example user_info and associate it with the users table, usually by the user_id field

N
Nikolay Kaspor, 2017-10-15
@this_nicco

it is possible to make fields for filling in data directly in this table, which he can then edit

H
Habitat Horsewithyou, 2017-10-17
@RagdollHorse

SELECT (SELECT login FROM users WHERE id=userinfo.idinfo ORDER BY id ASC LIMIT 1) as login FROM userinfo

idinfo in the user information table must match the id in the users table

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question