Show subscriber id in loop

You have already getting the student ID, Replace the following line of code

echo $student_info->user_id;

With

echo $student->ID;

Here’s a link!

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)