IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28669


Ignore:
Timestamp:
Jul 13, 2010, 3:45:38 PM (16 years ago)
Author:
Serge CHASTEL
Message:

Bug fix (first column name was 'forgotten')

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/columns_in_db.php

    r28654 r28669  
    2323// Table names query
    2424$tableNames = array (
    25             0 => "camRun",
    26             1 => "camProcessedExp",
    27             2 => "chipProcessedImfile",
    28             3 => "chipRun",
    29             4 => "fakeRun",
    30             5 => "rawExp",
    31             6 => "warpRun",
    32             7 => "warpSkyCellMap",
    33             8 => "warpSummary",
     25                     "Label",
     26                     "addMask",
     27                     "addProcessedExp",
     28                     "addRun",
     29                     "calDB",
     30                     "calRun",
     31                     "camMask",
     32                     "camProcessedExp",
     33                     "camRun",
     34                     "chipBackgroundImfile",
     35                     "chipBackgroundRun",
     36                     "chipImfile",
     37                     "chipMask",
     38                     "chipProcessedImfile",
     39                     "chipRun",
     40                     "dbversion",
     41                     "detInputExp",
     42                     "detNormalizedExp",
     43                     "detNormalizedImfile",
     44                     "detNormalizedStatImfile",
     45                     "detProcessedExp",
     46                     "detProcessedImfile",
     47                     "detRegisteredImfile",
     48                     "detResidExp",
     49                     "detResidImfile",
     50                     "detRun",
     51                     "detRunSummary",
     52                     "detStackedImfile",
     53                     "diffInputSkyfile",
     54                     "diffPhotRun",
     55                     "diffPhotSkyfile",
     56                     "diffRun",
     57                     "diffSkyfile",
     58                     "diffSummary",
     59                     "distComponent",
     60                     "distRun",
     61                     "distTarget",
     62                     "dqstatsContent",
     63                     "dqstatsRun",
     64                     "fakeMask",
     65                     "fakeProcessedImfile",
     66                     "fakeRun",
     67                     "flatcorrAddstarLink",
     68                     "flatcorrCamLink",
     69                     "flatcorrChipLink",
     70                     "flatcorrRun",
     71                     "magicDSFile",
     72                     "magicDSRun",
     73                     "magicInputSkyfile",
     74                     "magicMask",
     75                     "magicNodeResult",
     76                     "magicRun",
     77                     "magicTree",
     78                     "minidvodbProcessed",
     79                     "minidvodbRun",
     80                     "newExp",
     81                     "newImfile",
     82                     "publishClient",
     83                     "publishDone",
     84                     "publishRun",
     85                     "pzDataStore",
     86                     "pzDownloadExp",
     87                     "pzDownloadImfile",
     88                     "rawExp",
     89                     "rawImfile",
     90                     "rcDSFileset",
     91                     "rcDestination",
     92                     "rcInterest",
     93                     "rcRun",
     94                     "receiveFile",
     95                     "receiveFileset",
     96                     "receiveResult",
     97                     "receiveSource",
     98                     "stackAssociation",
     99                     "stackAssociationMap",
     100                     "stackInputSkyfile",
     101                     "stackRun",
     102                     "stackSumSkyfile",
     103                     "stackSummary",
     104                     "staticskyInput",
     105                     "staticskyResult",
     106                     "staticskyRun",
     107                     "summitExp",
     108                     "summitImfile",
     109                     "warpBackgroundRun",
     110                     "warpBackgroundSkyfile",
     111                     "warpImfile",
     112                     "warpMask",
     113                     "warpRun",
     114                     "warpSkyCellMap",
     115                     "warpSkyfile",
     116                     "warpSummary",
    34117                     );
    35118
     
    37120
    38121foreach ($tableNames as $tIndex => $tableName) {
    39         $sql = "show columns from `$tableName`";
    40         $qry = $db->query($sql);
    41         if (dberror($qry)) {
    42           echo "<b>error reading querying table</b><br>\n";
    43             echo "<br><small><b> table query : $sql </b></small><br>\n";
    44             menu_end();
    45         }
    46         if (!$qry->fetchInto($row)) {
    47           echo "<b>error querying table</b><br>\n";
    48           echo "<br><small><b>query : $sql </b></small><br>\n";
    49           menu_end();
    50         }
    51         $count = 0;
    52         $line = "";
    53         $values = array();
    54         while ($qry->fetchInto($row)) {
    55           foreach ($row as $index => $value) {
    56             if ($index == 0) {
    57               $values[] = $value;
    58             }
    59           }
    60         }
    61         asort($values);
    62         foreach ($values as $index => $value) {
    63           #echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$index." => ".$value."<br>";
    64           $count++;
    65             $line .= "<option value=\"$value\">$value</option>\n";
    66         }
    67         echo "<b>Table name: $tableName</b><br>\n";
    68         echo "Count = $count columns<br>\n";
    69         echo "<select name=\"blah\">\n".$line."\n</select><br>\n";
     122  $sql = "show columns from $tableName";
     123  $qry = $db->query($sql);
     124  if (dberror($qry)) {
     125    echo "<b>error reading querying table</b><br>\n";
     126    echo "<br><small><b> table query : $sql </b></small><br>\n";
     127    menu_end();
     128  }
     129  $count = 0;
     130  $line = "";
     131  $values = array();
     132  while ($qry->fetchInto($row)) {
     133    # print "[".$row[0]."]<br>\n";
     134    foreach ($row as $index => $value) {
     135      if ($index == 0) {
     136        $values[] = $value;
     137      }
     138    }
     139  }
     140  # print count($values)."<br>\n";
     141  asort($values);
     142  # print count($values)."<br>\n";
     143  foreach ($values as $index => $value) {
     144    #echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$count." => ".$value."<br>";
     145    $line .= "<option value=\"$value\">$count => $value</option>\n";
     146    $count++;
     147  }
     148  echo "<b>Table name: $tableName</b><br>\n";
     149  echo "Count = $count columns<br>\n";
     150  echo "<select name=\"blah\">\n".$line."\n</select><br>\n";
    70151}
    71152
Note: See TracChangeset for help on using the changeset viewer.