Support » Fixing WordPress » Php database password access

  • Hey, I’ve been trying to get a database running for some of my site’s data and haven’t found the plugins to be…flexible enough. So I’m trying to more directly play with the database through queries in php or such. I know my db username and password and such, my question is how do I securely open my database connection without my password hanging out there. I think I remember there being a good way to put it in a variable. Any ideas?

    specifically using the php call:
    $database=mysql_connect(“localhost”, db_user_here, db_pw_here);

Viewing 4 replies - 1 through 4 (of 4 total)
  • Anyone have an idea on this? I am to understand that hard coding the password onto the page calling the database is not a particularly secure idea, unless I’m offbase about that.

    Trying to sift through plugin code to see how they call the database, but not much luck so far.

    Moderator Jan Dembowski


    Brute Squad and Volunteer Moderator

    That’s not really a WordPress question and there are many articles on the Internet for answering that PHP/mysql question.

    Apparently it is a wordpress question. I may be able to get around needing to type information in by using the wpdb class. Which curiously is said to be instantiated as a global variable but says you still need to globalize it. Doesn’t say where it’s instantiated, will poke around.

    Apparently I just put

    global $wpdb;

    right before my code. Doesn’t…make entire sense to me but whatever.

    Should be enough for me to go off of now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Php database password access’ is closed to new replies.