comparing dates

mysql_select_db($database_db_housewaresdesignawards, $db_housewaresdesignawards);

$query_rsBanners = "SELECT ID, file_name, ad_type, start_date, url, impressions FROM hda_advertising WHERE display = ‘1’ AND start_date > = " . date(“Y-m-d”) . " AND end_date < = " . date(“Y-m-d”);

$rsBanners = mysql_query($query_rsBanners, $db_housewaresdesignawards) or die(mysql_error());

some prob in query …

Hi jushkhamar,

Notice your query:

[php]$query_rsBanners = "SELECT ID, file_name, ad_type, start_date, url, impressions FROM hda_advertising WHERE display = ‘1’ AND start_date > = " . date(“Y-m-d”) . " AND end_date < = " . date(“Y-m-d”);[/php]

You’re not actually selecting [php]end_date[/php] to use for your WHERE clause.

I hope this helps…

Sponsor our Newsletter | Privacy Policy | Terms of Service