Hi James,
   
  Yes, that sound like exactly what I would like to do - it looks pretty 
complicated....is it, or is it just because I'm new to php?  Would I have a web 
page (.html) that refers to both these tables or would everything have a .php 
extension (sorry, but i"ve been doing tutorials i'm finding on the web and I'm 
not quite sure what I should be naming the individual web pages - thanks again 
for your response, I will start looking for some code I can build on...

James Keeline <[EMAIL PROTECTED]> wrote:
          --- Sue Robinson <[EMAIL PROTECTED]> wrote:

> I'll try to be clear ! Sorry!
> 
> Anyone familiar with geocaching.com? Geocaching is kind of like a treasure
> hunt, you use GPS to find hidden containers. Some of these containers
> contain what are called "Travel Bugs" - usually an item of some sort, a toy
> or whatever that is attached to the official geocaching.com travel bug (they
> look like dog tags). Each one of the travel bugs has a unique number which
> you can search for, and then see the history of where it's been on their web
> page.
> 
> I would like to be able to do the same thing, only using my own unique
> numbers - I would place the item with the unique number in a cache and hope
> that whoever moved it would come to my web page and "log" it - obviously,
> they would have to be able to search for the number, log their new info on
> the web page,and see a new web page with the updated info. 
> 
> Hopefully, that is more clear? I'll try again if it's still confusing, or
> check out geocaching.com, go the "trackable items" and view the travel bug
> pages; I don't want or need anything that elaborate on my web site, just
> maybe a few fields that can be updated and the visitor can see the history of
> the travel bug. Thanks again for the help,
> 
> mp.

You may want multiple tables. For example, one table would have the item
description, photos, details, etc. and use a unique key to identify it. MySQL
does this well if the key is an integer. You can have a key value to be
displayed in one column but an integer for the true primary key. For a primary
key, only one row may exist for any particular value of the primary key.

The second table would be essentially a "log" with the primary key referring to
the other table (in database terminology a "foreign key") along with the data
you want to record about each event (date/time, location, who, etc.).

You will have to create queries which use both of these tables to look up the
data.

SELECT * FROM log l, items i WHERE l.id=i.id AND i.key='$key' ORDER BY dt DESC;

In this example I am assuming that the "items" table contains an integer
primary key ("id") and a human readable identifier ("key"). The "log" table
has a "dt" column with a datetime value (maybe even a timestamp value).

log
=====
lid INT PRIMARY KEY AUTO_INCREMENT
id INT
dt DATETIME
lat VARCHAR(32)
lon VARCHAR(32)
who VARCHAR(255)

items
=====
id INT
name VARCHAR(255)
desc TEXT

James



                         


http://www.suebob.net

[Non-text portions of this message have been removed]

Reply via email to