\n"); ?> Leizel & Jeff - Guestbook - View

View the Guestbook

MySQL unavailable.

Please try again in a little bit.

If problem persists, please report this error to the site admin.
"); exit(); } // Open database if(!@mysql_select_db("manmaru_wedding")) { echo("
Unable to connect to the wedding database.

Please try again in a little bit.

If problem persists, please report this error to the site admin.
"); mysql_close($dbWedding); exit(); } // Make query, sort by timestamp $sqlQuery = "SELECT * FROM guestbook ORDER BY timestamp DESC"; $sqlResults = mysql_query($sqlQuery); if(!$sqlResults) { echo("
Error when making top-level query.

Please try again in a little bit.

If problem persists, please report this error to the site admin.
"); exit(); } // If no entries, output a special "no entries yet" message if(mysql_num_rows($sqlResults) < 1) { echo("
There are no guestbook entries yet,
be the first to sign!

\n"); } else { // Loop through results and create output table-ified HTML entries while($sqlRow = mysql_fetch_array($sqlResults)) { echo("\n"); echo(" \n"); echo(" \n"); echo(" \n"); echo("
AuthorComment
\n"); echo(" " . htmlentities($sqlRow["name"], ENT_QUOTES) . "
\n"); if($sqlRow["location"] != "") echo(" " . htmlentities($sqlRow["location"], ENT_QUOTES) . "
\n"); //echo(" " . htmlentities($sqlRow["email"]) . "
\n"); //echo(" " . $sqlRow["ip"] . "
\n"); echo("
\n\n"); if($sqlRow["private"] == 1) echo("[ This message is private ]
"); else echo(nl2br(htmlentities($sqlRow["message"], ENT_QUOTES)) . "\n\n"); echo("
\n"); echo("
" . date('M d, Y', $sqlRow["timestamp"]) . " @ " . date('h:i a', $sqlRow["timestamp"]) . "
\n"); echo("
\n\n"); } } mysql_close($dbWedding); ?>