简体   繁体   中英

Can't connect my database on my live server

Hello I've been making a site on my local server and I finished it so I'm moving everything over to my live server. I've made a database in phpmyadmin on it and I would like to connect to it. I feel like I have the wrong inputs though because it gives me this error.

在此处输入图片说明

This is my code for my database connection.

<?php

return $conn = mysqli_connect('localhost', 'gener105_nate', '(Password)', 'user_data');

if (!$conn) {
    die("Connection Failed: " . mysqli_connect_error);
}

I didn't actually enter password I just think I shouldn't show it anyway I think I just have something mixed up since I'm new at this.

Oh and the database is located within a database grouping should i input the path to it?

在此处输入图片说明

您需要告诉它连接到gener105_user_data,而不只是user_data

return $conn = mysqli_connect('localhost', 'gener105_nate', '(Password)', 'gener105_user_data');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM