I need to get user information by id but it does not work. What is the error? .
it shows nothing. if you can help me thanks
<?php
if(is_user_logged_in()) {
global $wpdb;
$current_user = wp_get_current_user();
$results = $wpdb->get_results("SELECT postid FROM score WHERE ID={$current_user->ID}");
echo $results[0]->postid;
}
?>