[ PHPXref.com ] [ Generated: Sun Jul 20 19:56:00 2008 ] [ phpSQLiteAdmin 0.2 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> table_structure.php (source)

   1  <?php
   2  
   3  require_once ('include.php');
   4  
   5  ?>
   6  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
   7  <html>
   8  <head>
   9      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  10      <title>phpSQLiteAdmin</title>
  11      <meta http-equiv="expires" content="0">
  12      <script language="Javascript" src="javascript.txt" type="text/javascript"></script>
  13      <link href="phpsla.css" rel="stylesheet" type="text/css">
  14  </head>
  15  <body class=right>
  16  <?php
  17  
  18  print_top_links($_GET['object']);
  19  
  20  print "<h3>Table '{$_GET['object']}'</h3>\n";
  21  
  22  print "<table border=1>\n";
  23  print "<tr><th>Column</th><th>Type</th></tr>\n";
  24  $userdbh->_setTableInfo($_GET['object']);
  25  $cols = $userdbh->getColsType();
  26  while (list($key,$value) = each($cols)) {
  27      print "<tr><td>$key</td><td>$value</td></tr>\n";
  28  }
  29  print "</table>\n";
  30  
  31  print "<p>Rows in table: ".$userdbh->numRows($_GET['object'])."</p>\n";
  32  
  33  
  34  print "<h3>Indexes</h3>\n";
  35  
  36  $userdbh->getIndexesInfo($_GET['object']);
  37  $indexes = $userdbh->returnRows('assoc', true);
  38  
  39  $nr_indexes = count($indexes);
  40  
  41  /*
  42  print("<pre>");
  43  print_r($indexes);
  44  print("</pre>");
  45  exit;
  46  */
  47  
  48  if($nr_indexes > 0) {
  49      print "<table border=1>\n";
  50      print "<tr><th>Index name</th><th>On field(s)</th></tr>\n";
  51      foreach($indexes as $row) {
  52          if(eregi("\((.*)\)", $row['sql'], $fields)) {
  53              print "<tr><td>".$row['name'].'</td><td>';
  54              print $fields[1];
  55              print "</td></tr>\n";
  56          } else {
  57              print "<tr><td>".$row['name'].'</td><td>'.$row['sql']."</td></tr>\n";
  58          }
  59      }
  60      print "</table>\n";
  61      
  62  } else {
  63  
  64      print "<em>no indexes</em>\n";
  65  
  66  }
  67  
  68  
  69  print "</body>\n";
  70  print "</html>\n";
  71  
  72  
  73  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]