Lines Matching refs:db
22 static $db;
23 if (!is_null($db)) {
24 return $db;
27 $db = plugin_load('helper', 'sqlite');
28 if (is_null($db)) {
32 if($db->init('labeled', dirname(__FILE__).'/db/')){
33 return $db;
96 $db = $this->getDb();
99 $db->query('INSERT INTO labeled (id, label) VALUES (?,?)', $id, $label);
107 $db = $this->getDb();
108 $db->query('UPDATE labels SET color=? WHERE name=?', $newColor, $label);
120 $db = $this->getDb();
121 $db->query('DELETE FROM labeled WHERE id=? AND label=?', $id, $label);
134 $db = $this->getDb();
135 $db->query('DELETE FROM labeled WHERE id=?', $id);
162 $db = $this->getDb();
163 $db->query('UPDATE labels set name=? WHERE name=?', $newName, $label);
164 $db->query('UPDATE labeled set label=? WHERE label=?', $newName, $label);
178 $db = $this->getDb();
179 $res = $db->query('SELECT label FROM labeled WHERE id=?', $id);
181 $labels = $db->res2arr($res);
206 $db = $this->getDb();
207 $res = $db->query('SELECT name, color, namespace, ordernr FROM labels ORDER BY ordernr');
209 $labels = $db->res2arr($res);
229 $db = $this->getDb();
242 $db->query('UPDATE labels SET ordernr=? WHERE name=?', ($i+1), $keys[$i]);
266 $db = $this->getDb();
267 … $db->query('INSERT INTO labels (name, color, namespace) VALUES (?,?,?)', $name, $color, $ns);
278 $db = $this->getDb();
279 $db->query('DELETE FROM labels WHERE name=?', $label);
280 $db->query('DELETE FROM labeled WHERE label=?', $label);