Calendar Query

Posted on 2012-09-04
Last Modified: 2013-02-08
i have a simple calendar with a query. I have the problem that it does not display my end date correctly. If I enter in my calnedar 07.09.12 to 09.09.12 it only shows the days 7 and 8 used but not the last day 9. I think it is related to the query below:

$query_start = intval($_GET['start']);
$query_stop =  intval($_GET['stop']);
$query_iduser =  intval($_GET['uid']);
mysql_select_db($database_inburn, $inburn);
$query_events = sprintf('SELECT `name2` AS title, `start`, `stop` , `description`, `approved2` AS type, `event_id`, `userID5` FROM `_urlaub` WHERE UNIX_TIMESTAMP(`start`) <= %1$d AND (UNIX_TIMESTAMP(`stop`) >= %2$d OR (ISNULL(`stop`) AND UNIX_TIMESTAMP(`start`) >= %2$d))',$query_stop, $query_start, $query_iduser);
$events_set = mysql_query($query_events, $inburn) or die(mysql_error());  
$result_array = array();
while ($row = mysql_fetch_assoc($events_set))

Question by:michael789
    1 Comment
    LVL 25

    Accepted Solution

    Does your `stop` value have a time component?  If it does, it would probably be past your input stop value as it is a date and would end a midnight AM ... before the `stop` datetime.  You may want to try
       AND (UNIX_TIMESTAMP(DATE(`stop`))

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now