Trying to connect to external db
-
Hello! so what I’m trying to do is exactly what the person at this link was trying to do but I see that were never able to update on their progress. I am trying to edit the code on the page recommended in that thread, but I’m not sure I’m doing the right thing and I thought you might be able to help me. I instantiated a new wpdb object called “mydb” like this:
$mydb = new wpdb(‘username’,’password’,’database’,’host’);
(with my credentials of course)After that I edited every instance of wpdb related to login and password to be mydb so the queries look like this:
$seplog_check_login_user = $mydb->get_row( $mydb->prepare(“SELECT * FROM customer WHERE username = %s OR email = %s”, $seplog_user_login_posted, $seplog_user_login_posted));
I also changed ‘user_id’ to customer_id, as that’s what’s in my table. Obviously it did not work, but that’s why I’m here. I’m not a great coder, so here we are.
- The topic ‘Trying to connect to external db’ is closed to new replies.