Calendar Query

Posted on 2012-09-04
Medium Priority
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

lwadwell earned 2000 total points
ID: 38363346
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

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

839 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