Hello, I would like an example of a command that his answer is in MySQL. (Example /coins, and show how many coins the player has). * This message was translated into Google Translator. Sorry, my English is not good. My function getDatabase: public function getDatabase() { new \mysqli("localhost", "root", "test", "stone"); }
I recommend using the libasynql Virion, it's easier to use than mysqli and also works asynchronously, because otherwise your server will hang while executing the query which could make the gameplay choppy when a lot of players use your command: https://github.com/poggit/libasynql
Sorry, I don't have any simple examples, try taking a look at the plugins that are mentioned at the bottom of that README. You can also check out other plugins that use it: https://github.com/search?q=libasynql&type=Code If I had the time, I'd quickly write an example plugin for you, but I have a lot of exams the following days.