[thelist] php/mysql : selecting all rows that match a date range

noah noah at tookish.net
Fri Jan 4 15:51:47 CST 2002


At 04:22 PM 04/01/2002, John Corry wrote:
>But the query "select filmTitle, filmDescr, filmImage, filmDirector,
>filmRating, filmRuntime, filmLink, showings.showingDate from films, showings
>where showings.showingDate <= DATE_ADD(showings.showingDate, INTERVAL 1
>MONTH)"
>
>Doesn't behave as expected...it returns films matching that criteria, but
>like...6 times each!

This may or may not help, but when I've run into records being returned 
multiple times, it has always turned out to be a problem with a JOIN that 
is causing the record to be returned once for each row in a JOINed table. 
If one of your tables has 6 rows, I'd look into this.

(I'm pretty novice on the SQL front, so apologies if this is just noise).

HTH,
Noah





More information about the thelist mailing list