I need some help with the database

Asked

Viewed 29 times

0

I have this table in my database

Tabela 1

And I need that under the Created, have 1 option called Payment (within this option with two options, PAY(I WANT YOU TO ALREADY COME WITH THIS STANDARD) and after that I can change to (PAID). There’s a way I can do that?

Quero que ela venha assim, para mim depois alterar o valor PAGAR, para PAGO

  • I recommend creating a type column TINYINT(1) calling for pago, where you record 0 for items payable and 1 for paid items. If you want to display something else (like "pay" for zero value), do this on your front end, not in the database.

1 answer

0


You can do this easily in Phpmyadmin, I made an example, copy it the way it is.

Exemplo

To change the PAGAR for PAGO, do:

UPDATE tabela SET Pagamento='PAGO' WHERE id='1';

Where tabela you complete with your table name and 1 the user you want to change from.

  • And when I need to change to PAY, instead of PAY, as I do ?

  • I edited my answer.

  • Thanks, it worked out now !

  • This returning me this error, Parse error: syntax error, Unexpected 'Snaps' (T_STRING) in

  • It is a mistake with a variable called 'Snaps', it has nothing to do with my answer. Create another question so as not to leave this too wide. Don’t forget to mark the answer as correct.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.