You've used the literal localhost in your mysqli() connection call, when it expected a string. Put that in quotes, as well as any other parameters that should be strings, unless you've defined them all elsewhere as constants, but from your comment above about blanking out the access details I would imagine you intended strings and not constants.