• Hey all,

    I wrote some code directly in functions.php for creating something like a tagcloud. Which wordked out fine when I was testing this on a wamp localhost server..
    When I’m trying to integrate the exact same code into an online site.. It’s giving me the following error.

    access denied for user ‘blabla’@’localhost’ (using password yes)

    I’m trying to connect to like to the database the same way I did it on my local server.. And yes I’m sure my user/password is correct..

    $db = new mysqli(“localhost”, “blabla”, “my_pass”, “my_database”);

    Anyone an idea of what i’m doing wrong ?
    Should I use something else than “localhost”?

    Thanks!

    Greats,

    Davey

Viewing 2 replies - 1 through 2 (of 2 total)
  • You might have to use something different to localhost. That depends on what your hosting company has set up. they are the first people to ask about this as it’s almost always some problem with the settings that they’ve given that they need to work out.

    Just making sure though… This is a stupid question, but you never know.

    You’re not trying to connect to the database on your local machine from the web server are you?

    Maybe you should use $wpdb?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Problem connecting to database’ is closed to new replies.