Jump to content

Recommended Posts

Hi,

 

I upload the banner, and in dbase I have columns:

 

`banner_year` (examlpe: 2007)

`banner_month` (example: 08)

`banner_day` (example: 24)

 

I want to banner expire 24. avgust 2007. (mean that 25. august I can see anymore that banner)

 

query is:

 

$query_banner = mysql_query("SELECT * FROM `banner` WHERE `banner_year` >= '".date("Y")."' AND `banner_month` >= '".date("m")."', `banner_day` >= '".date("d")."' ORDER BY `banner_order` ASC");

 

BUT its not good? because I need to look month and day together, not separately...

 

Please help me...

 

thnxs

 

Link to comment
https://forums.phpfreaks.com/topic/58528-solved-expire-banner/
Share on other sites

metrostars, youre great!

 

$query_return = mysql_query("INSERT INTO `banner` (
	`banner_link`,
	`banner_date`,
	`banner_datetime`,
	`banner_ip`
	)
	VALUES (
	'".$_POST['banner_link']."',
	'".$_POST['banner_year'].$_POST['banner_month'].$_POST['banner_day']."',
	'".date("Y-m-d H:i:s")."',
	'".getenv("REMOTE_ADDR")."'
	)");

 

Query return:

 

$query_banner = mysql_query("SELECT * FROM `banner` WHERE `banner_date` >= '".date("Ymd")."' AND `banner_onoff` = '1' ORDER BY `banner_order` ASC");

 

Its work perfectly!

 

THANX!

Link to comment
https://forums.phpfreaks.com/topic/58528-solved-expire-banner/#findComment-290321
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.