Changeset 14783 for trunk/FACT++


Ignore:
Timestamp:
01/21/13 12:25:38 (12 years ago)
Author:
tbretz
Message:
Added an option which allows to retrieve a complete list of all sources from the db.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/smartfact/index.php

    r14400 r14783  
    108108}
    109109
     110if (isset($_GET['sourcelist']))
     111{
     112    $server = mysql_connect($dbhost, $dbuser, $dbpass);
     113    if (!$server)
     114        die(mysql_error());
     115
     116    if (!mysql_select_db($dbname, $server))
     117        die(mysql_error());
     118
     119    $result = mysql_query("SELECT fSourceName AS name FROM source", $server);
     120    if (!$result)
     121        die(mysql_error());
     122
     123
     124//    var res = db.query("SELECT fSourceName, fRightAscension, fDeclination ",
     125//              "FROM source");
     126
     127   // store the record of the "example" table into $row
     128
     129    // Print out the contents of the entry
     130
     131    while ($row=mysql_fetch_array($result, MYSQL_NUM))
     132        print("'".$row[0]."'\n");
     133
     134    mysql_close($server);
     135
     136    return;
     137
     138}
     139
    110140if (isset($_GET['logout']))
    111141{
Note: See TracChangeset for help on using the changeset viewer.