sir localhost is not working in site so tell me what is host name
localhost is your hostname yes
Try PDO example
If you need RemoteMYSQL