HI,
I want to write a query for displaying ads.Ads may be many but all advertisements should not be displayed on the web page.only according to the date that particular ad should appear on the web page.please guide me in writing the query for my above doubt.please help me out.Hope i'll get my answer soon.
Thanking you,
ok, Let's suppose your database contains this table:
Table : ad (advertiserID,advertiserBanner,startingDate,finish ingDate)
One way is to list all the ads that contain today's date (if you're changing the advertisement every 24 hours) and then show the resulted records accordingly.
An example query would be:
-
select * from ad
-
where curdate() between startingDate and finishingDate
-
The function curdate() returns the current Date. This is mysql function.
Regards,
Aram Azhari