Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting ( E_ALL );
- $connection = mysql_connect('localhost',"sernec","sernec");
- if(!$connection){ die('Not connected : '.mysql_error()); }
- $db_selected = mysql_select_db("SERNEC",$connection);
- if(!$db_selected){ die('Cant use db: '.mysql_error()); }
- if (isset($_GET["state"])) {
- $state_name = mysql_real_escape_string ($_GET["state"]);
- // echo $_GET['state'];
- }
- $query = "Select DISTINCT Genus FROM Tennessee";
- if(isset($_GET["county"])){
- if(isset($_GET["county"])!="SelectALL" ){
- $county_name=mysql_real_escape_string ($_GET["county"]);
- $query = "Select DISTINCT Genus FROM Tennessee WHERE State='$state_name' AND County='$county_name' ORDER BY Genus";
- }
- //echo $_GET['county']
- else
- $query = "Select DISTINCT Genus FROM Tennessee WHERE State='".$state_name."' ORDER BY Genus";
- }
- $result = mysql_query($query);
- if(!$result){
- die('Invalid query: ' .mysql_error());
- }
- ?>
- <select name="genus" onChange="display(this.value)">
- <option> Select Genus</option>
- <?while($row=mysql_fetch_array($result)){?>
- <option><?=$row['Genus']?></option>
- <?}?>
- </select>
- <?php
- echo "<table border='1'>";
- /*echo '<tr><th>StateName</th><th>CountyName</th><th>Fips</th><th>Count</th><th>Entries</th><th>Category</th><th>ID1</th><th>ID</th><th>Family</th><th>Genus</th><th>Sp$
- while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
- {
- echo "<tr>";
- echo '<td>' . $row['ID1'] . '</td>';
- echo '<td>' . $row['ID'] . '</td>';
- echo '<td>' . $row['Family'] . '</td>';
- echo '<td>' . $row['Genus'] . '</td>';
- echo '<td>' . $row['Species'] . '</td>';
- echo '<td>' . $row['ScientificNameAuthor'] . '</td>';
- echo '<td>' . $row['Subspecies'] . '</td>';
- echo '<td>' . $row['Variety'] . '</td>';
- echo '<td>' . $row['Country'] . '</td>';
- echo '<td>' . $row['State'] . '</td>';
- echo '<td>' . $row['County'] . '</td>';
- echo '<td>' . $row['Collector'] . '</td>';
- echo '<td>' . $row['Locality'] . '</td>';
- echo '<td>' . $row['Latitude'] . '</td>';
- echo '<td>' . $row['Longitude'] . '</td>';
- echo '<td>' . $row['InstitutionalCode'] . '</td>';
- echo '<td>' . $row['CollectionCode'] . '</td>';
- echo '<td>' . $row['CatalogueNumber'] . '</td>';
- echo "</tr>";
- }
- echo "</table>";
- mysql_close($connection);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement