Reply to Re: IF and OR in a query

Your name:

Reply:


Posted by Ewoud Dronkert on 06/05/05 14:29

On Sun, 05 Jun 2005 04:11:25 -0700, Chris wrote:
> So a question becomes, IF jul (is selected in the query for the month
> of July) THEN return any data for junjul AND julaug if they were used
> on the input form and have that data returned under a July query.
>
> Any thoughts?

Assuming you will sensibly have 2 date fields in your table:

$month = 7; // July
$sql = "SELECT id FROM planning WHERE MONTH(startdate)=$month OR
MONTH(enddate)=$month";


--
Firefox Web Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация