I added a new row to my table, keeping track of the game number in the round, thus it will have values 1,2,3,4.... when round ends it will be reset to 1 etc
it will be pretty simple to code this with php or similar just doing
$x=1++
while(round == 1){
INSERT INTO events (game_nr) values ('$x')
$x++
}
Is there something similar I can use as the above code on a mysql db using only mysql?
Read manual Defined Variables in mysql
SET @x := 1; -- Define a variable
INSERT INTO events (game_nr) values (@x := @x + 1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With