PhpLabWare version 0.3 
/dd/ -> 0_0023_inc.php

1  <?php
2 
3  // 0_0023_inc.php - defines pdf reprint related tables
4  // 0_0023_inc.php - author: Nico Stuurman <nicost@sourceforge.net>
5 
6    /***************************************************************************
7    * Copyright (c) 2001 by Nico Stuurman *
8    * ------------------------------------------------------------------------ *
9    * Creates tables pdfs,pd_type1, and inserts initial values *
10    * *
11    * *
12    * *
13    * This program is free software; you can redistribute it and/or modify it *
14    * under the terms of the GNU General Public License as published by the *
15    * Free Software Foundation; either version 2 of the License, or (at your *
16    * option) any later version. *
17    \**************************************************************************/
18 
19  $query="CREATE TABLE pdfs (
20          id int PRIMARY KEY,
21          access char(9),
22          ownerid int,
23          magic int,
24          pmid int,
25          title text,
26          author text,
27          type1 int,
28          type2 int,
29          volume int,
30          fpage int,
31          lpage int,
32          year int,
33          abstract text,
34          notes text,
35          lastmodby int,
36          lastmoddate int,
37          date int)";
38  if (!$db->Execute($query)) $test=false;
39  $db->Execute("CREATE INDEX pdfs_id_index ON pdfs (id)");
40  $db->Execute("CREATE INDEX pdfs_ownerid_index ON pdfs (ownerid)");
41  $db->Execute("CREATE INDEX pdfs_date_index ON pdfs (date)");
42  $db->Execute("CREATE INDEX pdfs_type1_index ON pdfs (type1)");
43  $db->Execute("CREATE INDEX pdfs_magic_index ON pdfs (magic)");
44  $db->Execute("CREATE INDEX pdfs_title_index ON pdfs (title)");
45  $db->Execute("CREATE INDEX pdfs_title_index ON pdfs (title(10))");
46  // holds journal names
47  $query="CREATE TABLE pd_type1
48          (id int PRIMARY KEY,
49           sortkey int,
50           type text,
51           typeshort text)";
52  if (!$db->Execute($query)) $test=false;
53  $db->Execute("CREATE INDEX pd_type1_id_index ON pd_type1 (id)");
54  $db->Execute("CREATE INDEX pd_type1_sortkey_index ON pd_type1 (sortkey)");
55  // for keywords?
56  $query="CREATE TABLE pd_type2
57          (id int PRIMARY KEY,
58           sortkey int,
59    type text,
60           typeshort text)";
61  if (!$db->Execute($query)) $test=false;
62  $db->Execute("CREATE INDEX pd_type2_id_index ON pd_type2 (id)");
63  $db->Execute("CREATE INDEX pd_type2_sortkey_index ON pd_type2 (sortkey)");
64 
65  $tablesid=$db->GenID("tableoftables_id_seq");
66  $query="INSERT INTO tableoftables VALUES ($tablesid,300,'pdfs','pd')";
67  if (!$db->Execute($query)) $test=false;
68  ?>


Generated: Sun Oct 5 21:17:35 2003 SourceForge Logo Generated by PHPXref 0.2