Hide record for user

0

By "deleting" a precise record it hides it from a table in the user's view, but it must remain in the database. I put a field called ' status ' in the table that manages just that. In the view I put a ' if ' that performs the filter at the time of 'select'. Showing only records with ' status == 1 '.

So far so good, my problem is to give ' update ' to just change the value of ' status ' from 1 to 0. At the moment the user chooses to delete.

    
asked by anonymous 27.03.2018 / 20:13

2 answers

0

If your case is just to update in the bank this example resolves:

UPDATE COMPANY SET ADDRESS = 'Texas' WHERE ID = 6;

UPDATE sua_tabela SET seu_campo = valor_para_alterar WHERE ID = id_que_sera_atualizado;
    
27.03.2018 / 20:36
1

When you try to delete check the status of the record, and if it is 1 it updates to 0 and passes the bank pointer to the next record.

    
27.03.2018 / 20:59