Phpfunction

146
-1

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
146
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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);}?>

×