Creation of EVENT in PHPMYADMIN

Asked

Viewed 77 times

0

Next, I have a game server and I’m trying to automate the purchase of cash on my site ( the user buys cash to spend on the game ).

I have a table in my bank called USERS:

user_id (A.I)
user_name
user_pass
user_email 
dias_vip (definido por padrão = 0 )

And I have a table called ORDERS:

id (A.I)
descricao
status
user_name

The USERS table is commanded by my registration page, OK.

The order table only works when the person is logged in to the site and buys "cash" to spend in the game. And it is activated along with the pagseguro. In short, the user logs in to the site and has a purchase button of 100 cashs, he clicks on this button and then I write the user_name in the ORDERS table and the status = 1 ( q is the standard of pagseguro for "WAITING FOR PAYMENT" ). When the person makes the payment automatically I receive a notification from Pagseguro and a function changes the status to 3 which means "PAID".

Here’s the question: I wonder if there’s a way I can create an EVENT that adds the value 100 in the dias_vip field of the USERS table when the payment status is 3.

If anyone can help me, that’s all I need to finish this process, thank you!.

  • You can put a Rigger in your table when the status is 3, Rigger checks and update indicating the days. http://www.devmedia.com.br/mysql-triggers/8088

  • Yes, I was told I can do it, but I don’t understand the language to do it. I managed to make the days_vip decrease 1 day using EVENT, but this one I’m not getting...

No answers

Browser other questions tagged

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