/** * Set the details used to connect to the database * @param string Database server name * @param string Database name * @param string Username * @param string Password */ public static function setDetails($host, $dbname, $username, $password) { self::$host = $host; self::$dbname = $dbname; self::$username = $username; self::$password = $password; }
public static function init_connection($host, $db, $table, $username, $password) { self::$host = $host; self::$db = $db; self::$table = $table; self::$user = $username; self::$password = $password; self::$mysqli = new mysqli(self::$host, self::$user, self::$password, self::$db); return self::$mysqli->ping(); }
new Compile($newer); } return $newer; } public static function goToTable($table) { if (preg_match_all(sprintf(Initialize::$replace["goToTable"], $table, $table, $table), Compose::databaseFile2(), $codes)) { new Compile($codes); } else { echo "nej"; } } } $db = new Database("test", "testUsername", "testPassword"); $db->database(); $db->username(); $db->password(); $db->comments(); $db->tables(); new Compile(Compose::databaseTableRows()); // COLLECT * FROM Accounts $test = Compose::databaseTableRows()["Accounts"]; //new Compile($test); foreach (Compose::databaseTableRows()["Accounts"] as $key => $value) { echo $value["Username"] . '<br>'; } //echo Compose::databaseUsername() . '<br>'; //echo Compose::databasePassword(); //new Compile(Compose::databaseCode()); echo '<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><br><br><br><br><br><br><br><pre>' . file_get_contents("databases/test.rdb") . '</pre>';
public static function databasePassword($password) { Database::$password = $password; }