I am new in this field, I am trying to get some skills to be a web developer, kind of. This is the error I get when opening the file in my browser:
Parse error: syntax error, unexpected end of file on line 26.
this is the code:
<?php
$servername = "";
$username = "";
$password = "";
$dbname = "";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($mysqli->connect_error) {
echo "Failed to connect to MySQL: " . $mysqli->connect_error;
}
$sql = "CREATE TABLE MyColor (
color
)";
if ($conn->query($sql) === TRUE) {
echo "Table MyColor created successfully";
} else {
echo "Error creating table: " . $conn->error;
$conn->close()
?>