database date output
-
I am running a query that is pulling from the database the post_title, the post_name, and the post_date. I am then outputting rows with this information. However the date is coming out like this: 2012-11-05 22:09:13 and I need it to come out like this: November 5, 2012 . Here is the code:
$query_y = "SELECT post_title, post_name, post_date FROM $table_name WHERE post_type='post' AND year(post_date) = '$i' AND post_status = 'publish' ORDER BY post_date DESC"; $myrows = $wpdb->get_results($query_y); echo "<ul class='custom'>"; foreach($myrows as $myrow) { $title = $myrow->post_title; $permalink = $myrow->post_name; $date = $myrow->post_date; echo "<li>".$date."<br /><a href='".$permalink."' title='".$title."'>".$title."</a></li>";
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘database date output’ is closed to new replies.