我想获得特定用户的最后修改/创建日期,然后回显它。
我想做的是:
<?php $id = get_the_ID();
global $current_user;
$current_user = wp_get_current_user();
$postID = $id; //assigning post id
$userID = $current_user->ID; // assigning user ID
$sql = "SELECT post_date FROM wp_posts WHERE ID = $postID AND post_author = $userID ORDER BY post_date DESC LIMIT 1";
$userModifiedDate = $wpdb->query($sql);
echo $userModifiedDate; ?>
我的错误在哪里?谁能带领我完成这个?
此刻$userModifiedDate
还给我1
。