Closed aerosox closed 8 years ago
db.php
is just a helper that returns a Medoo instance. A new database can be created using the SQL in the readme.
i follow the guides but im still getting "Failed to fetch a list of teams. Retrying in 3 seconds..." in IITC
db.php
<? // Or if you just download the medoo.php into directory, require it with the correct path. require 'medoo.php';
$database = new medoo([ 'database_type' => 'sqlite', 'database_file' => 'teamkeys.db' ]);
$database->insert("account", [ "user_name" => "foo", "email" => "foo@bar.com" ]); ?>
db.php needs to return $database
, and also probably shouldn't be trying to insert things...
return $database as in query?
Not sure what you mean by query. The entire contents of my db.php looks like this:
<?
require_once getenv("PHPLIB") . "medoo.min.php";
return new medoo([
"database_type" => "sqlite",
"database_file" => getenv("DATA") . $dbFile
]);
Here, $dbFile
is defined by the script that imports db.php. You probably don't want the getenv()
calls as part of your require paths (though PHP may default that to empty for you).
The alternative is not to have a db.php at all (I only use this as I have many projects using SQLite DBs in a standard place) -- just replace lines 3 and 4 in teamkeys.php with:
require_once "medoo.php";
$db = new medoo(["database_type" => "sqlite", "database_file" => "teamkeys.db"]);
where can i get this 2 file?