Update of /cvsroot/openfirst/guestbook
In directory sc8-pr-cvs1:/tmp/cvs-serv12815
Modified Files:
deleteentry.php deleteyes.php index.php signthanks.php
Log Message:
Replace mysql functions with new database functions, allowing multiple database types to be used easily.
Index: deleteentry.php
===================================================================
RCS file: /cvsroot/openfirst/guestbook/deleteentry.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** deleteentry.php 24 Jul 2003 00:42:20 -0000 1.5
--- deleteentry.php 23 Aug 2003 20:21:00 -0000 1.6
***************
*** 39,49 ****
$query = "SELECT * FROM ofirst_guestbook WHERE deletecode='$deletecode' and email='$email';";
! $result = mysql_db_query("$sqldatabase",$query);
if ($result) {
! while ($r = mysql_fetch_array($result)) {
! $date = $r["date"];
! $email = $r["email"];
! $deletecode = $r["deletecode"];
}
?>
--- 39,49 ----
$query = "SELECT * FROM ofirst_guestbook WHERE deletecode='$deletecode' and email='$email';";
! $result = ofirst_dbquery($query);
if ($result) {
! while ($r = ofirst_dbfetch_object($result)) {
! $date = $r->date;
! $email = $r->email;
! $deletecode = $r->deletecode;
}
?>
Index: deleteyes.php
===================================================================
RCS file: /cvsroot/openfirst/guestbook/deleteyes.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** deleteyes.php 24 Jul 2003 00:42:20 -0000 1.5
--- deleteyes.php 23 Aug 2003 20:21:00 -0000 1.6
***************
*** 39,43 ****
$query = "DELETE FROM ofirst_guestbook where deletecode='$deletecode' and email='$email';";
! $result = mysql_db_query("$sqldatabase",$query);
?>
--- 39,43 ----
$query = "DELETE FROM ofirst_guestbook where deletecode='$deletecode' and email='$email';";
! $result = ofirst_dbquery($query);
?>
Index: index.php
===================================================================
RCS file: /cvsroot/openfirst/guestbook/index.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** index.php 20 Aug 2003 15:33:41 -0000 1.5
--- index.php 23 Aug 2003 20:21:00 -0000 1.6
***************
*** 40,45 ****
<?php
- mysql_select_db("$sqldatabase");
-
if(isset($_GET["perpage"]) == false || (int)$_GET["perpage"] == 0) { $_GET["perpage"] = 5; }
--- 40,43 ----
***************
*** 53,65 ****
$query = "SELECT * FROM ofirst_guestbook ORDER BY guest LIMIT " . $_GET["start"] . ", " . $_GET["perpage"] . ";";
! $result = mysql_query($query);
$querytotal = "SELECT * FROM ofirst_guestbook;";
! $resulttotal = mysql_query($querytotal);
! echo("There has been a total of " . mysql_num_rows($resulttotal) . " messages posted to this guestbook.");
if ($result) {
! while ($r = mysql_fetch_object($result)) {
echo("<hr /><p>$r->date
--- 51,63 ----
$query = "SELECT * FROM ofirst_guestbook ORDER BY guest LIMIT " . $_GET["start"] . ", " . $_GET["perpage"] . ";";
! $result = ofirst_dbquery($query);
$querytotal = "SELECT * FROM ofirst_guestbook;";
! $resulttotal = ofirst_dbquery($querytotal);
! echo("There has been a total of " . ofirst_dbnum_rows($resulttotal) . " messages posted to this guestbook.");
if ($result) {
! while ($r = ofirst_dbfetch_object($result)) {
echo("<hr /><p>$r->date
Index: signthanks.php
===================================================================
RCS file: /cvsroot/openfirst/guestbook/signthanks.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** signthanks.php 15 Aug 2003 18:53:39 -0000 1.8
--- signthanks.php 23 Aug 2003 20:21:00 -0000 1.9
***************
*** 57,61 ****
$query = "INSERT INTO ofirst_guestbook VALUES('" . $_POST["guest"] . "', '" . $_POST["email"] . "', '" . $_POST["icq"] . "', '" . $_POST["aim"] . "', '" . $_POST["msn"] . "', '" . $_POST["yim"] . "', '" . $_POST["irc"] . "', '" . $_POST["webpage"] . "', '" . $_POST["location"] . "', '" . $_POST["comment"] . "', '" . date("D M j G:i:s T Y") . "', '$deletecode');";
! $result = mysql_db_query("$sqldatabase",$query);
$message = "Someone has posted a message in your guestbook.
--- 57,61 ----
$query = "INSERT INTO ofirst_guestbook VALUES('" . $_POST["guest"] . "', '" . $_POST["email"] . "', '" . $_POST["icq"] . "', '" . $_POST["aim"] . "', '" . $_POST["msn"] . "', '" . $_POST["yim"] . "', '" . $_POST["irc"] . "', '" . $_POST["webpage"] . "', '" . $_POST["location"] . "', '" . $_POST["comment"] . "', '" . date("D M j G:i:s T Y") . "', '$deletecode');";
! $result = ofirst_dbquery($query);
$message = "Someone has posted a message in your guestbook.
|