Hello, in the code below, how would I convert 24 hour time to 12 hour time and put date format as 8/27/13?
Also how in the select statement could I add where wp_events_start_end.end_time is greater than 6pm?
Result: 2013-08-27 End Time: 19:30
<?php
$username = "";
$password = "";
$hostname = "localhost";
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "<br>";
?>
<?php
//select a database to work with
$selected = mysql_select_db("stormwi1_wrd1",$dbhandle)
or die("Could not select stormwi1_wrd1");
?>
<?php
//execute the SQL query and return records
$result = mysql_query("SELECT wp_events_detail.id,
wp_events_detail.event_name,
wp_events_detail.start_date,
wp_events_start_end.end_time
FROM wp_events_detail
join wp_events_start_end on wp_events_detail.id = wp_events_start_end.event_id
WHERE wp_events_detail.start_date = curdate() - INTERVAL DAYOFWEEK(curdate())-3 DAY
order by wp_events_detail.start_date");
//fetch tha data from the database
while ($row = mysql_fetch_array($result)) {
echo
"".$row{''}."
".$row{'start_date'}.
" End Time: ".$row{'end_time'}."<br>";
}
?>
<?php
//close the connection
mysql_close($dbhandle);
?>