chiark / gitweb /
prefer to use ids to names; names aren't even valid in divs
[ypp-sc-tools.db-live.git] / yarrg / web / pirates
index 5378cf44637bf487f17b4118381b1695f59675cc..158239dd5a7a98cbcb57088f0b1cb7a8601e23a3 100644 (file)
@@ -21,19 +21,6 @@ $sth->execute();
 <input type=submit name=submit value="Go">
 </form>
 
-
-use DBI;
-
-our $dbh;
-our $dbfn;
-$dbfn= "/home/ijackson/things/ypp-sc-tools.pctb-dict-test/yarrg/OCEAN-Midnight.db";
-    $dbh=DBI->connect("dbi:SQLite:$dbfn",'','',
-                       { AutoCommit=>0,
-                         RaiseError=>1, ShowErrorStatement=>1,
-                         unicode=>1 })
-        or die "$dbfn $DBI::errstr ?";
-    # default timeout is 30s which is plenty
-
 my $sth=$dbh->prepare(
     "SELECT a.commodname,b.price,c.price,d.stallname,e.islandname
      FROM commods as a
@@ -64,3 +51,9 @@ $sth->execute();
 
 </BODY>
 </HTML>
+
+<%init>
+use CommodsWeb;
+db_setocean('Midnight');
+db_connect();
+</%init>