\n"; } else { // print "Date '$date' or num '$num' bad.
\n"; print "Error
I do not recognize the format of the file you are attempting to access. Please email me.

View Adventures Index
Return to Darxus' Home Page
\n"; exit; } $db = mysql_connect("localhost","root","mysqlf00") or die("Could not connect to db."); if (mysql_select_db("adventures",$db)) { // print("Database opened successfully.
\n"); } else { printf("Error opening database: %s.
\n", mysql_error()); } $result = mysql_query("SELECT id, title FROM entries WHERE date='$date' AND num='$num'",$db); if($myrow = mysql_fetch_array($result)) { $title=$myrow[title]; $id=$myrow[id]; } else { //printf("No records found: %s.
\n", mysql_error()); print "Error
Entry does not exist. Please email me.

View Adventures Index
Return to Darxus' Home Page
\n"; exit; } $links = "\n"; $nextid = $id+1; $result = mysql_query("SELECT date, num, title FROM entries WHERE id=$nextid",$db); if($myrow = mysql_fetch_array($result)) { $myrow[num] = sprintf ("%02d", $myrow[num]); $nexturl = "entry.php?date=$myrow[date]&num=$myrow[num]"; $links .= "\n"; } else { //printf("No records found: %s.
\n", mysql_error()); $next = ""; } $previd = $id-1; $result = mysql_query("SELECT date, num, title FROM entries WHERE id=$previd",$db); if($myrow = mysql_fetch_array($result)) { $myrow[num] = sprintf ("%02d", $myrow[num]); $prevurl = "entry.php?date=$myrow[date]&num=$myrow[num]"; $links .= "\n"; } else { //printf("No records found: %s.
\n", mysql_error()); $previous = ""; } $links .= "
next:$myrow[title]$myrow[date]
previous:$myrow[title]$myrow[date]
\n"; function relate ($entry) { global $db; print "
Related Entries\n\n"; $num_args = func_num_args(); for ($ndx = 0; $ndx < $num_args; ++$ndx) { $entry = func_get_arg ($ndx); list($date, $num) = split(' ', $entry); //print "Date:$date:Num:$num:
\n"; $result = mysql_query("SELECT title FROM entries WHERE date='$date' AND num='$num'",$db); if($myrow = mysql_fetch_array($result)) { print "\n"; } else { printf("No records found: %s.
\n", mysql_error()); } } print "
$myrow[title]$date
\n"; } ?> <?print($title)?> "); } if ($prevurl) { print(""); } ?>

"); include($file); print "
\n$links"; ?>
Comment on this page.
Return to Adventures index
Return to Darxus' home page.