How to verify field in MYSQL before doing UPDATE [closed]

1

I have a question ...

I'm doing a service order system and the customer is given a secret PIN

When the technician arrives, he must request the pin to change the status of the PENDING order to IN PROCESS.

The PIN is in MYSQL How can I check the PIN and if it is correct, the technician can change the status of the order?

I'm with PHP AND MYSQL

the pin is in the PIN column and the status of the order is in the STATE column

That is, if the pin is correct, make UPDATE in the state field and change it from PENDING to IN PROCESS.

Thank you very much for your answers

    
asked by Rafael Dorado 12.02.2018 в 09:57
source

1 answer

3

well you could do a stored procedure

you will send as a parameter the technician's PIN

and you could use something like

IF();

To evaluate the PIN sent with the base PIN you can document more about this topic here enter the description of the link here

    
answered by 12.02.2018 / 11:21
source