How to generate external url in WordPress

@Sam is close, but I think you need to do this:

$url="http://www.example.com";

Without the protocol in front, you get the wrong result. Change to

$url="https://www.example.com";

if you need an SSL link.

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