Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Phpfunction

231 views

Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Phpfunction

  1. 1. <?phpfunctionprintTitle(){ 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><?phpprint "<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 forprint "t</tr>n"; } // end whileprint "</table>n";mysql_free_result($result_array);}?>

×