Re: query, INTERVAL problem
| From: | nabil | Date: | Sun, 01 Jun 2003 12:07:49 +0000 |
| Subject: | Re: query, INTERVAL problem | ||
| References: | 1 2 3 4 5 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-28194@lists.php.net to get a copy of this message | ||
usually the mysql convert it to 2003-01-01 type without using this
function... especially if it came from a form submission, am i right ?
"Nabil" <nabil.attar@aws-syria.com> wrote in message
news:20030527122847.90658.qmail@pb1.pair.com...
> ok make it as
>
> $sql = "SELECT doc_id, exam_date FROM exams WHERE doc_id='$doc_id' and
> exam_type_id= '1' and result='PASS' and '$due_date' >
> (exam_date +
INTERVAL
> 11 MONTH) ";
>
> and still have a diffrent records when i use '20030501' than '2003-05-01'
>
>
>
> "Jason Wong" <php-db@gremlins.biz> wrote in message
> news:200305271748.27813.php-db@gremlins.biz...
> > On Tuesday 27 May 2003 17:03, nabil wrote:
> > > No Jason, what I meant that I submit the date value from a form to
> MySQL,
> > > to execute a query as I said below, and it returns deferent value for
> that
> > > ...
> > >
> > > when I send $due_date as '20030501' the query return a different than
> > > '2003-05-01'
> > >
> > > Hope I make clear..
> >
> > Nope, still not clear at all. Your query is:
> >
> > > $sql = "SELECT doc_id FROM exams WHERE doc_id='$doc_id' and
> exam_type_id=
> > > '1' and result='PASS' and '$due_date' > (exam_date +
> > > INTERVAL 11
MONTH)
> ";
> >
> > You're only selecting doc_id. Are you saying that performing the above
> query
> > doc_id is '2003-05-01' !?!
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.biz
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> > ------------------------------------------
> > Search the list archives before you post
> > http://marc.theaimsgroup.com/?l=php-db
> > ------------------------------------------
> > /*
> > Kludge, n.:
> > An ill-assorted collection of poorly-matching parts, forming a
> > distressing whole.
> > -- Jackson Granholm, "Datamation"
> > */
> >
>
>