);
);
$rv = $db->do($stmt);
-
- $st = $db->prepare('INSERT INTO CAT VALUES (?,?,?)');
- $st->execute(1,"Unspecified", "For quick uncategorised entries.");
- $st->execute(3,"File System", "Operating file system short log.");
- $st->execute(6,"System Log", "Operating system important log.");
- $st->execute(9,"Event", "Event that occured, meeting, historically important.");
- $st->execute(28,"Personal", "Personal log of historical importants, diary type.");
- $st->execute(32, "Expense", "Significant yearly expense.");
- $st->execute(35, "Income", "Significant yearly income.");
- $st->execute(40, "Work", "Work related entry, worth monitoring.");
- $st->execute(45, "Food", "Quick reference to recepies, observations.");
+ insertDefCats($db);
}
+ #Have cats been wiped out?
+ $st = $db->prepare('SELECT count(ID) FROM CAT;');
+ $st->execute();
+ if($st->fetchrow_array()==0) {
+ insertDefCats($db);
+ }
+
+
$st = $db->prepare(selSQLTbl('AUTH'));
$st->execute();
if(!$st->fetchrow_array()) {
return "SELECT name FROM sqlite_master WHERE type='table' AND name='$name';"
}
+sub insertDefCats{
+ my
+ $st = $_[0]->prepare('INSERT INTO CAT VALUES (?,?,?)');
+ $st->execute(1,"Unspecified", "For quick uncategorised entries.");
+ $st->execute(3,"File System", "Operating file system short log.");
+ $st->execute(6,"System Log", "Operating system important log.");
+ $st->execute(9,"Event", "Event that occured, meeting, historically important.");
+ $st->execute(28,"Personal", "Personal log of historical importants, diary type.");
+ $st->execute(32, "Expense", "Significant yearly expense.");
+ $st->execute(35, "Income", "Significant yearly income.");
+ $st->execute(40, "Work", "Work related entry, worth monitoring.");
+ $st->execute(45, "Food", "Quick reference to recepies, observations.");
+ $st->finish();
+}
+
sub populateConfig{
my $db = shift;
my $st = $db->prepare('INSERT INTO CONFIG VALUES (?,?,?)');