Hi,
My table
PHP Code:
CREATE TABLE IF NOT EXISTS contest (
  
id int(10unsigned NOT NULL auto_increment,
  
title varchar(255NOT NULL,
  
slug varchar(255NOT NULL,
  
description text,
  
valid_from date NOT NULL,
  
valid_to date NOT NULL,
  
PRIMARY KEY  (id),
  
UNIQUE KEY unique_contest_title (title),
  
UNIQUE KEY unique_contest_slug (slug)
ENGINE=InnoDB  DEFAULT CHARSET=utf8;


INSERT INTO contest (idtitleslugdescriptionvalid_fromvalid_toVALUES
(1'my first cool contest''my-first-cool-contest''my desc''2012-05-01''2012-05-31'); 
What's the query to know if a new contest overlap an old contest ?
I don't want two or more contest in the same time.
By now I ended up with this simple query
PHP Code:
SELECT id FROM pc_contest WHERE valid_from '2012-05-10' OR valid_to '2012-05-31' 
and it seems to work but I'd like to know your opinion

Bye