On Saturday 07 December 2002 11:39, Miguel Brás wrote:
> Ok guys,
>
> having a problem here. I did my table with 6 fields, they are:
> id  position  name  timein  timeout  date
>
> I have a form to insert the info on the fields, and at the date field, I
> have a drop down menu that returns me the next 7 days (the date in d/m/y),
> people will choose the date they want and that will be stored on the table.
>
> Now I want to retrieve the position, name, timein and timeout from by table
> and display it on a page. But I want only the records for the present date.
> I inserted the info on my table and on the date's field I inserted 07/12/02
> and 06/12/02 just for testing
>
> I called the data via a query: SELECT position, name, timein, timeout, date
> FROM table WHERE date=NOW()
> It was supposed that only the record from the present date was shown. But
> not, I can't have anything. Only the custom message I did if nothing was
> available

NOW() returns the current date and TIME. Use CURRENT_DATE or CUR_DATE() to get 
just the date portion.

> One more thing, how can I do to prevent that different people apply for a
> same position, on the same day and during the "shift" of the first one that
> applied?

Check the archives, there was a thread in the last couple of days about 
"Checking for Overlapping Dates". The same principles should apply so it may 
be useful reading.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Abstainer, n.:
        A weak person who yields to the temptation of denying himself a
        pleasure.
                -- Ambrose Bierce, "The Devil's Dictionary"
*/


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

Reply via email to