PHP: public $config = [ "host" => "0.0.0.0", "user" => "user", "password" => "password", "database" => "database", "port" => 3306 ]; $this->database = new \mysqli($this->config["host"], $this->config["user"], $this->config["password"], $this->config["database"], isset($this->config["port"]) ? $this->config["port"] :
*sigh* PHP: class Main extends PluginBase implements Listener{ public $config = [ "host" => "0.0.0.0", "user" => "user", "password" => "password", "database" => "database", "port" => 3306 ]; public $isSpinning = []; public $istesting = []; public function onEnable() { ##EXTERNAL PLUGIN ROUTES### $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->getServer()->getPluginManager()->registerEvents(new Rewards($this), $this); $this->getServer()->getPluginManager()->registerEvents(new EventListener($this), $this); $this->getServer()->getPluginManager()->registerEvents(new Protection($this), $this); $this->epe = $this->getServer()->getPluginManager()->getPlugin("EssentialsPE"); $this->getServer()->getScheduler()->scheduleRepeatingTask(new Hud($this), 100); $this->getServer()->getScheduler()->scheduleRepeatingTask(new CEChecker($this), 20); $this->prot = new Protection($this); $this->reward = new Rewards($this); @mkdir($this->getDataFolder()); if(!is_dir($this->getDataFolder() . "playersfolder/")) { mkdir($this->getDataFolder() . "playersfolder/"); } ##exec("rar a -r pluginbackup+1.rar $path/plugins"); Tile::registerTile(CustomChest::class, true); $this->database = new \mysqli($this->config["host"], $this->config["user"], $this->config["password"], $this->config["database"], isset($this->config["port"]) ? $this->config["port"] : 3306); if($this->database->connect_error){ $this->getLogger()->critical("Couldn't connect to MySQL: ". $this->database->connect_error); $this->getServer()->getPluginManager()->disablePlugin($this); return; } $this->getLogger()->info(TF::AQUA . "Connected to MySQL!"); $table = "CREATE TABLE creditz ( ChatMessages INT(255) UNSIGNED DEFAULT 0)"; if(mysqli_query($this->database, $table)){ $this->getLogger()->notice("Created Mysql Table!"); }else{ $this->getLogger()->critical("Mysql Table Failed To Generate!".mysqli_error($this->database));
You don't need to \mysqli because it is a function (like strtolower(), not \strtolower()). Recompile PHP with MySQL.
Is it possible for Android to run this shell script? Code: #!/bin/bash # Requirements: curl, sudo, tar, building tools [ -z "${PREFIX}" ] && PREFIX=/usr/local [ -w "${PREFIX}" ] || SUDO=sudo set -e mkdir -p work cd work curl -fsSL http://www.php.net/distributions/php-7.0.15.tar.xz | tar -xJf - --strip-components=1 ./configure \ --disable-cgi \ --enable-mbstring \ --enable-bcmath \ --enable-sockets \ --with-curl \ --with-libedit \ --with-openssl \ --with-zlib \ --with-mysqli\ --enable-pcntl \ --enable-maintainer-zts \ --prefix="${PREFIX}" make -j`nproc` $SUDO make install $SUDO "${PREFIX}/bin/pecl" install channel://pecl.php.net/pthreads-3.1.6 channel://pecl.php.net/weakref-0.3.2 channel://pecl.php.net/yaml-2.0.0 echo "phar.readonly = off extension = yaml.so extension = pthreads.so extension = weakref.so zend.assertions = -1 " | $SUDO tee "${PREFIX}/lib/php.ini" > /dev/null cd .. rm -rf work