You can't connect using all four parameters on mysqli_connect()
From the above code i can tell your
host : "localhost"
user: "dbuser"
password: ""
database name: "database"
Do this,
$conn = mysqli_connect("localhost", "dbuser", "");
mysqli_select_db($conn, "database");
// to check if you're connected, after tested and see you can take off the code below...
if ($conn) {
echo "Connected";
} else {
echo "Connection failed";
}
if you seriously want to connect using all four parameter above?
$conn = new mysqli("localhost","dbuser","","database");
// to check if you're connected, after tested and see you can take off the code below...
if ($conn) {
echo "Connected";
} else {
echo "Failed";
}
Hope this was helpful?