/* this material is provided with ABSOLUTELY NO GUARANTEE. use at your own risk. always test on non-critical systems first. source code developed by Melonfire, http://www.melonfire.com/ copyright 2001, Melonfire. all rights reserved. visit our Web site to find out how you can use this source code and accompanying article on your Web site. */ ?> // form not submitted if (!$submit) { ?>
// get data for this appointment to pre-fill form include("config.php"); // open a connection to the database $connection = mysql_connect($server, $user, $pass); // formulate the SQL query - same as above $query = "SELECT * from calendar where id='$id'"; // run the query on the database $result = mysql_db_query($db,$query ,$connection); while($row = mysql_fetch_array($result)) { $this_time = explode(":", $row["time"]); $this_date = $row["date"]; $comment = $row["comment"]; $hh = $this_time[0]; $mm = $this_time[1]; } // close connection mysql_close($connection); ?>