Upload files to wp-content/uploads – What to add in DB?

There is media_handle_sideload() function in core meant for processing files not uploaded through media interface.

It’s not exactly what you need since it assumes file is outside of uploads and needs to be moved there as part of process, but it should give you and idea on generating and inserting it as valid attachment.

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