Code in custom widget queries all posts, when it should only query the current post

Solved it!

I replaced $ww_book_id = $post->ID; with $ww_book_id = get_the_ID();

I’m not sure why $post->ID; was referencing all the posts in the widgetized version of this code. If anyone can tell me, I’d be very curious.

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