Jump to content

Showing End time


SkyRanger

Recommended Posts

I am working on a code that I started along time ago but having problem showing the end time, could somebody please have a look at my code to see what I am missing. 

 

Thanks

 

$getEvent_sql = "SELECT id, event_title, event_shortdesc,
                date_format(event_start, '%l:%i %p') as fmt_date, date_format(event_end, '%l:%i %p') as fmt_enddate FROM
                calendar_events WHERE month(event_start) = '".$m."'
                AND dayofmonth(event_start) = '".$d."' AND
                year(event_start)= '".$y."'  ORDER BY event_start";
$getEvent_res = mysql_query($getEvent_sql, $mysql)
                or die(mysql_error($mysql));

if (mysql_num_rows($getEvent_res) > 0){
        $event_txt = "<ul>";
        while($ev = @mysql_fetch_array($getEvent_res)){
                $evid = $ev["id"];
			$event_title = stripslashes($ev["event_title"]);
                $event_shortdesc = stripslashes($ev["event_shortdesc"]);
                $fmt_date = $ev["fmt_date"];
                $fmt_enddate = $ev["fmt_enddate"];
                $event_txt .= "<li><a href=editevent.php?id=$evid>$editevent</a><a href=deleteevent.php?id=$evid>$deleteevent</a><strong>".$fmt_date."</strong>:
                              ".$event_title."<br/>".$event_shortdesc."</li>";
        }
        $event_txt .="</ul>";
        mysql_free_result($getEvent_res);
} else {
        $event_txt = "";
}

mysql_close($mysql);

if ($event_txt != ""){
        echo "<p><strong>Today's Events:</strong></p>
        $event_txt
        <hr/>";
}

Link to comment
Share on other sites

Hi Pikachu2000 this is what i have so far

 

 



if (mysql_num_rows($getEvent_res) > 0){
        $event_txt = "<ul>";
        while($ev = @mysql_fetch_array($getEvent_res)){
                $evid = $ev["id"];
			$event_title = stripslashes($ev["event_title"]);
                $event_shortdesc = stripslashes($ev["event_shortdesc"]);
                $fmt_date = $ev["fmt_date"];
                $fmt_enddate = $ev["fmt_enddate"];
                $event_txt .= "<li><a href=editevent.php?id=$evid>$editevent</a><a href=deleteevent.php?id=$evid>$deleteevent</a><strong>".$fmt_date."</strong>:
                              ".$event_title."<br/>".$event_shortdesc."</li>";
        }
        $event_txt .="</ul>";
        mysql_free_result($getEvent_res);
} else {
        $event_txt = "";
}

mysql_close($mysql);

if ($event_txt != ""){
        echo "<p><strong>Today's Events:</strong></p>
        $event_txt
        <hr/>";
}

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.