php login with login [closed]

0

I need to make a calendar with login where I make my registration in the system and I login .

After login, register my calendar lines in the lugar , pais and descrição fields.

I can save as many lines as I want in "my page", after doing logout , someone else logs in on the page and sees his data, not mine.

I do not know how to do this, save data using the id of each user, and then pull the data by id tanbem.

    
asked by anonymous 07.04.2015 / 20:59

1 answer

0

Exactly the way you thought, the basic structure of the database would look something like this:

[USUARIO]
id_usuario
login
senha

[LINHA] // Como chamou
id_linha
id_usuario // Correspondente a quem está cadastrando
numero
descricao
lugar
pais

When you log in, you can save the user id in the session and register it along with the line in the user_id field

When listing your lines you will filter by the id of the logged-in user, eg

SELECT * FROM linha WHERE id_usuario = X ORDER BY descricao

Hope it helps

Hugs

    
07.04.2015 / 21:39