Init
require_once "sleekdb/SleekDB.php";
$databaseDirectory = __DIR__ . "/db";
$currentstore = new \SleekDB\Store("data", $databaseDirectory);
Code-Sprache: PHP (php)
Loop
$currentstore = new \SleekDB\Store("data", $databaseDirectory);
$tags = $currentstore->findBy(["user_id", "=", $_SESSION['user_id']]);
foreach($tags AS $item) {
echo '<a href="'.$item['tag_id'].'">'.$item['title'].'</a>';
}
Code-Sprache: PHP (php)
Find by 2 parameters
$tags = $currentstore->findBy([[["user_id", "=", $_SESSION['user_id']],], "AND", [["tag_id", "=", $tag_id]]]);
Code-Sprache: PHP (php)
Find One
$user_id = $_SESSION["user_id"];
$currentstore = new \SleekDB\Store("tags", $databaseDirectory);
$data = $currentstore->findOneBy(["user_id", "=", $user_id]);
echo $data["_id"];
Code-Sprache: PHP (php)