troubleshooting Question

Help with Date Function

Avatar of katlees
katleesFlag for United States of America asked on
PHPMySQL Server
9 Comments1 Solution326 ViewsLast Modified:
I have the code below and the only problem I am having is it drops off an event that is occuring for the current date. Example...

If an event is entered for today (2012-05-23) at 15:30:00 it should display until 15:30:01

Nothing is showing up for 2012-05-23

Any help?
  <?php

$currenttime = date('H:i:s');
			$currentdate = date('Y-m-d H:i:s');
				$sql = "SELECT * FROM Events WHERE LevelID LIKE '%1%' AND StartDate >= '$currentdate' ORDER BY StartDate, StartTime Limit 10";
			

	$sql_result = mysql_query($sql);

	$calendar_html = "";
	$first_one = 1;
echo"<div class=\"inner\">\n";
	while ($dept_button_row = mysql_fetch_assoc($sql_result))
	{
		$dept_button_id = $dept_button_row['ID'];
		$dept_button_Event = $dept_button_row['Event'];
		$dept_button_StartDate = $dept_button_row['StartDate'];
		$dept_button_StartTime = $dept_button_row['StartTime'];
		$dept_button_LocationID = $dept_button_row['LocationID'];
		$dept_button_OpponentID = $dept_button_row['OpponentID'];
		$dept_button_Gender = $dept_button_row['Gender'];
		$dept_button_Level = $dept_button_row['LevelID'];
		$event_time = mysql2timestamp1($dept_button_StartDate);
        $event_display_date = date("m/d/y", $event_time);

		$display_time = date('g:i A', strtotime($dept_button_StartTime));
		
		echo"<div class=\"wrapper\">
                                    	<a href=\"#\" class=\"link1\">$event_display_date</a><div class=\"text1\"><a href=\"#\">$dept_button_Event</a></div>
                                        
                                         <a href=\"#\" class=\"link11\">$display_time</a>
                                    </div>
                                    <div class=\"border\"></div>\n";
	}
	echo "</div>\n";
	?>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros