Impossible to get Attachments Outside WordPress?

Your older code seems to work just fine, if there were issues with it – something else caused them.

Your updated version seems to take a step back since your loop is written like main loop and is not using $queryObject that you set up.

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