How do I reliably find a URL to a script or other file?

Does this help?:

return plugins_url('/js/'. $scriptPath, '__FILE__');

OR

return plugins_url('/code/<your php file name here>', '__FILE__');

Try the Codex for plugins_url as well.

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