Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Daniel Fisher
August 28, 2004, 5:52 pm
rate this thread
I'm fairly new to PhP and basicly trying to learn right now. Now I have
a problem - I have a fairly large collection of movies which people keep
borrowing from me. And then not returning. So I've put together an
Access database with three tables - my media library, a list of friends
and email addresses, and a borrow table which uses foreign keys from the
other two tables to see who has borrowed what. Borrow Table also has two
other fields - the date borrowed, which is set to equal now() inside of
access, and the date due, which is set to equal now()+14 - they are both
Now I had another prloblem which was this: people would call me up at
ungodly hours of the night asking if I had, say, The Excorcist. I would
have to turn on my monitor, load up access, and then scroll through the
list in order to confirm weather or not I had that title (I do). I've
solved this problem by having a really cool and sexy PhP script which
querries the database with an SQL querry based on the user's form. So
thats that problem solved...
So my friends come round at 2:45am wanting to borrow, say The Excorcist,
or Mememento, and four weeks later I am looking for the exact same
title. With my cool and sexy database its now really easy to know who
has what, but what I really want is a PhP script (which I can set to run
automaticly via the task scheduler) which would see what was overdue and
then email that person asking them to return it.
So a fairly simple problem but its been giving me a headache for the
better part of three weeks. Now() in PhP returns the Unix datatime, I
believe, which is of course not immediately compatible for comparison
with the date-time returned by Access which is of this form:
I dont really mind how this problem is solved - weather by SELECTing
from the database WHERE overdue < now(), or by doing the same thing
using PhPs date() function.
But I would very much like some help wiht this problem as it has been
plaguing me for three weeks now.
(IIS and Apache on WinXP Prof. Corp. PhP version 4.3.7. Dynamic DNS:
http://djcf.sytes.net . The script I am working on is here:
Re: PhP, Access/SQL, Date comparison problem. (I'm new to PhP)
For something like this I usually store the date as a UNIX timestamp
then use PHP date() to format back to something sensible. The time
stamp is a simple integer, so it's really easy to work with.
Of course this involves a 'cool and sexy' php script to enter stuff into
the database in the first place, but then, I'd probably be using My SQL
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker /
- » PHPBB2, PHP 4.3.4, MySQL 4.1.1, Apache 2.0.49, Fedora 2
- — Next thread in » PHP Scripting Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum