I don't know how to replace some data if a "user" already exists.
I've tried ON DUPLICATE KEY UPDATE
but I came to realize that this will probably not work. Because the only value that isn't updated is 'user' in my code but the other 3 values are constantly updated every 5 minutes.
INSERT INTO online ( `user`, `bot`, `world`, `status` ) VALUES ('$User', '$Name', '$World', '$status')
ON DUPLICATE KEY UPDATE bot = VALUES ('$Name'), world = VALUES ('$World'), status = VALUES ('$status')
The idea is if, for example, user "bob" already exists update his other 3 values bot
, world
, status
, instead of creating a new line and so on.
Edit: this is how I have it setup in Mysql