Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////////
- /* How to Connect your Plugin to MySQL Database */
- /* This method is not OOP but works :P */
- //////////////////////////////////////////////////
- // Just Modify things you want to do. It all - //
- // depends in what your going to do. //
- //////////////////////////////////////////////////
- $config = $this->plugin->getConfig()->get("MySQLi Details");
- $mysql_hostname = $config["host"];
- $mysql_user = $config["user"];
- $mysql_password = $config["password"];
- $mysql_database = $config["database"];
- $bd = mysqli_connect($mysql_hostname, $mysql_user, $mysql_password);
- mysqli_select_db($bd, $mysql_database);
- $name = trim(strtolower($player->getName());
- $sql = "UPDATE table_name SET value = 'data to update' WHERE name='".$name."'";
- $result = mysqli_query($bd, $sql);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement