exit; } $db->groupBy("customerId"); $cnt = $db->get("users", null, "customerId, count(id) as cnt"); if ($db->count != 2) { echo "Invalid records count with group by"; } $upData = array('expires' => $db->now("+5M", "expires"), 'loginCount' => $db->inc()); $db->where("id", 1); $cnt = $db->update("users", $upData); if ($db->count != 1) { echo "Invalid update count with functions"; exit; } $db->where("id", 1); $r = $db->getOne("users"); if ($db->count != 1) { echo "Invalid users count on getOne()"; exit; } if ($r['password'] != '546f98b24edfdc3b9bbe0d241bd8b29783f71b32') { echo "Invalid password were set" . exit; } $db->where("id", array('1', '2', '3'), 'IN'); $db->get("users"); if ($db->count != 3) { echo "Invalid users count on where() with in "; exit; } $db->where("id", array('2', '3'), 'between'); $db->get("users");
$db = new Mysqlidb('db.utfapp.com', 'htv', '123qweasd', 'htv'); if (!$db) { die("Database error"); } use Curl\Curl; $curl = new Curl(); require_once __DIR__ . '/../lib/Dropbox/strict.php'; $appInfoFile = __DIR__ . "/web-file-browser.app"; // NOTE: You should be using Composer's global autoloader. But just so these examples // work for people who don't have Composer, we'll use the library's "autoload.php". require_once __DIR__ . '/../lib/Dropbox/autoload.php'; use Dropbox as dbx; $requestPath = init(); session_start(); if ($requestPath === "/") { $user = $db->getOne('user'); $dbxClient = new dbx\Client($user['session'], "PHP-Example/1.0"); //$dbxClient = getClient(); if ($dbxClient === false) { header("Location: " . getPath("dropbox-auth-start")); exit; } $path = "/Pictures"; if (isset($_GET['path'])) { $path = $_GET['path']; } $entry = $dbxClient->getMetadataWithChildren($path); if ($entry['is_dir']) { echo renderFolder($entry); } else { echo renderFile($entry);