Home arrow PHP arrow Page 4 - Cracking The Vault (part 2)

All Revved Up - PHP

The first part of this article discussed the basic design andarchitecture for an intranet document management system. In this concludingpart, get to the good stuff with a discussion of the "check in" and "checkout" process, and add a simple search engine to the system.

  1. Cracking The Vault (part 2)
  2. Checking It Out
  3. Room With A View
  4. All Revved Up
  5. Looking For Something?
  6. Oops!
  7. Endgame
By: Vikram Vaswani, (c) Melonfire
Rating: starstarstarstarstar / 2
May 16, 2001

print this article


You'll remember that the document information page, "details.php", also contains a link to the document's revision history. That history is generated by the script "history.php", which queries the "log" table to build a list of changes made to the document.

The first part of the script simply provides the same document information seen in "details.php" - the description, size and so on. Once that's over with, a query to the "log" and "user" tables builds a list of changes made to the specific file, sorted by date.

<table border="0" cellspacing="5" cellpadding="5"> <tr> <td><font size="-1"><b>Modified on</b></font> <td><font size="-1"><b>By</b></font> <td><font size="-1"><b>Note</b></font> </td> </tr> <? // query to obtain a list of modifications $query = "SELECT user.username, log.modified_on, log.note FROM log, user WHERE log.id = '$id' AND user.id = log.modified_by ORDER BY log.modified_on DESC"; $result = mysql_db_query($database, $query, $connection) or die ("Error in query: $query. " . mysql_error()); // iterate through resultset while(list($modified_by, $modified_on, $note) = mysql_fetch_row($result)) { ?> <tr> <td><font size="-1"><? echo fixDate($modified_on); ?></font></td> <td><font size="-1"><? echo $modified_by; ?></font></td> <td><font size="-1"><? echo $note; ?></font></td> </tr> <? } // clean up mysql_free_result($result); ?> </table>

Here's a sample screen.

This article copyright Melonfire 2001. All rights reserved.

>>> More PHP Articles          >>> More By Vikram Vaswani, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: