PHP Gurus,
        What I'm trying to accomplish can be done in PHP, but someone on
this list told me once that it's far more efficient to try and do as
much on the MySQL side as possible. But I'm not really enough of an SQL
guy to join an SQL list, so I hope I can be forgiven this posting here.
        I'm looking right now at mysql.com's online manual, at the date
and time functions page. I'm pretty sure it is describing the function I
need, but I can't quite understand how they describe the syntax.
        What I have is a table which contains a series of events which
have a field that specifies the date on which they occur. I have two
fields to specify the workshop. One is a date field, which specifies
year, month, and date. Then I have a separate time field for the start
time of the event, specifying hours and minutes.
        What I want to be able to do is select an event based on whether
or not the start time is within 3 days from now.
        What's got me confused are two things:
        1. How do I combine the two fields in one SQL query in order to
make a complete start time useful for comparing dates? 
        2. I think INTERVAL is the command I want to use. Is what I'm
after something like the following (I put in question marks where I'm
not sure how that variable would be formed)?
        SELECT date(?) FROM table WHERE DATE_ADD(now(?), INTERVAL 72
HOURS)

-- 
Yoroshiku!
Dave G
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to