So I have this site. And I want to edit a div based on some database data.
I found out that a fairly easy solution would be to connect with mysqli("servername", "username", "password", "database")
.
Problem is, I can't connect to the database
I think it has to do with what I should input to the servername
username
and password
fields.
I have tried for the servername:
- localhost
- damon.multiserver.gr (which is the hostname of the myphp database)
- I also performed nslookup to damon.multiserver.gr and used that ip
- the site's url
for the username:
- root
- created new user with desired permissions
for the password:
- ""
- the password from the user I created
The database elements are in multiple languages, including Greek.
$mysqli = new mysqli("localhost:3306", "root", "", "grcrenta_2020");
if($mysqli->connect_error) {
exit('Could not connect');
}
...more code
Thanks in advance for your help :)