How to create a screen type for each user?

0

I am creating an online system in real time, for now I only know html5 / css3 / js .. How do I as soon as the client logs in the information from it appears to it and not from another client? I do not think it would be a good idea to create .html files for each client.

    
asked by anonymous 09.08.2016 / 05:35

1 answer

1

My suggestion is that you create a client table, for example, and at the moment of login you save the client's login ID in the session. Later, in the queries, insertions, changes ... finally, in the actions in the database, you must validate the client ID. For example:

In the customer table you have the columns: Id, Name, CNPJ, Status.

In the product table you have the columns: Id, Name, Weight, Value, CustomerID.

When you select products, for example, you will use:

SELECT C.Nome AS Clietne, P.Nome AS Produto, P.Peso, P.Valor
FROM Produtos P 
INNER JOIN Clientes C ON (P.IdCliente = C.Id)
WHERE P.IdCliente = $_SESSION['sIdCliente']
    
09.08.2016 / 22:13