Apidays New York 2024 - The value of a flexible API Management solution for O...
Phpfunction
1. <?php
functionprintTitle()
{
return "Archived Weather Records";
}
function run($dbname, $link)
{
/* Run the query on the database through the connection */
$query = "select * from weatherdata_archive";
$result_array = mysql_db_query($dbname, $query, $link);
print "<h2>Old weather data table</h2>";
?>
<form action="list_weather_data_old.php" method="post">
<p>SearchBy ID: <input type="text" name="searchid" size="15" maxlength="20"
value="" />
<input type="submit" name="submit" value="Search" /></p><br/> <br/>
</form>
<?php
print "<table border=0>
<tr>
<th align=left>Data ID</th>
<th align=left>Data/time</th>
<th align=left>Node ID</th>
<th align=left>Outdoor Temp</th>
<th align=left>Indoor Temp</th>
<th align=left>Humidity</th>
<th align=left>Wind Speed</th>
<th align=left>Airpressure</th>
<th align=left>Wind direction</th>
<th align=left>Rainfall</th>
<th align=left>Wind Chill</th>
</tr>n";
/* While there are still rows in the result set,
assign the current row to the array $row */
while ($row = mysql_fetch_assoc($result_array))
{
print "t<tr>n";
/* Print out each element in row, that is,
print the values of the attributes */
foreach ($row as $col_value)
{
print "tt<td>$col_value</td>n";
} // end for
print "t</tr>n";
} // end while
print "</table>n";
mysql_free_result($result_array);
}
?>