Update of /cvsroot/openfirst/manual
In directory sc8-pr-cvs1:/tmp/cvs-serv13098
Modified Files:
index.php
Log Message:
Replace mysql functions with new database functions, allowing multiple database types to be used easily.
Index: index.php
===================================================================
RCS file: /cvsroot/openfirst/manual/index.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** index.php 12 Aug 2003 21:01:08 -0000 1.2
--- index.php 23 Aug 2003 20:23:25 -0000 1.3
***************
*** 32,41 ****
<h1>Manual</h1>
<?php
- mysql_select_db($sqldatabase);
if(isset($_GET["chapter"]) == false && isset($_GET["id"]) == false && isset($_POST["ID"]) == false && isset($_GET["doc"]) == false) {
echo("<p>The following manuals exist, and are able to be read and commented on:</p>");
! $query = mysql_query("SELECT document FROM ofirst_manual GROUP BY document;");
! if(mysql_num_rows($query) == 0) { echo("<p>There is currently no documentation available.</p>"); }
! while($q = mysql_fetch_object($query)) {
echo($q->document);
}
--- 32,40 ----
<h1>Manual</h1>
<?php
if(isset($_GET["chapter"]) == false && isset($_GET["id"]) == false && isset($_POST["ID"]) == false && isset($_GET["doc"]) == false) {
echo("<p>The following manuals exist, and are able to be read and commented on:</p>");
! $query = ofirst_dbquery("SELECT document FROM ofirst_manual GROUP BY document;");
! if(ofirst_dbnum_rows($query) == 0) { echo("<p>There is currently no documentation available.</p>"); }
! while($q = ofirst_dbfetch_object($query)) {
echo($q->document);
}
***************
*** 44,49 ****
echo("<h2>Table of Contents</h2>");
$query = "SELECT ID, title, chapter FROM ofirst_manual ORDER BY chapter, title WHERE document='" . $_GET["doc"] . "';";
! $q = mysql_query($query);
! while($t = mysql_fetch_object($q)) {
if($t->chapter != $lastchapter) {
echo("<h3>Chapter $t->chapter</h3>");
--- 43,48 ----
echo("<h2>Table of Contents</h2>");
$query = "SELECT ID, title, chapter FROM ofirst_manual ORDER BY chapter, title WHERE document='" . $_GET["doc"] . "';";
! $q = ofirst_dbquery($query);
! while($t = ofirst_dbfetch_object($q)) {
if($t->chapter != $lastchapter) {
echo("<h3>Chapter $t->chapter</h3>");
***************
*** 58,63 ****
echo("<p><strong>Note Added.</strong></p>");
$query = "SELECT notes FROM ofirst_manual WHERE ID='$id';";
! $q = mysql_query($query);
! $t = mysql_fetch_object($q);
$query = "UPDATE ofirst_manual SET notes='$t->notes [note-break]<strong>" .
--- 57,62 ----
echo("<p><strong>Note Added.</strong></p>");
$query = "SELECT notes FROM ofirst_manual WHERE ID='$id';";
! $q = ofirst_dbquery($query);
! $t = ofirst_dbfetch_object($q);
$query = "UPDATE ofirst_manual SET notes='$t->notes [note-break]<strong>" .
***************
*** 67,71 ****
$_POST["email"] . "<br /> " .
$_POST["note"] . "' WHERE ID='$id' AND document='$doc';";
! $q = mysql_query($query);
} else {
$id = $_GET["id"];
--- 66,70 ----
$_POST["email"] . "<br /> " .
$_POST["note"] . "' WHERE ID='$id' AND document='$doc';";
! $q = ofirst_dbquery($query);
} else {
$id = $_GET["id"];
***************
*** 73,78 ****
$query = "SELECT * FROM ofirst_manual WHERE ID='$id' AND document='" . $doc . "';";
! $q = mysql_query($query);
! $f = mysql_fetch_object($q);
echo("<h2>$f->title</h2>
<h3>$f->functionname</h3>
--- 72,77 ----
$query = "SELECT * FROM ofirst_manual WHERE ID='$id' AND document='" . $doc . "';";
! $q = ofirst_dbquery($query);
! $f = ofirst_dbfetch_object($q);
echo("<h2>$f->title</h2>
<h3>$f->functionname</h3>
|