I am fairly new to HTML and PHP, i know SQL and that's what i'm trying to use here (in PHP).
This is what i am using to create a simple connection to the SQL server, but this won't even work:
<html>
<h1>Test</h1>
<?php
$servername = "localhost";
$username = "username"; // Ofc with my SQL details.
$password = "password";
$conn = new mysqli($servername, $username, $password);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
But it get to this part connect_error) {
and from there it just displays the code. Example:
^^ This is what comes up.
I think it has something to do with the PHP as it looks as if it's getting to the > and then thinking that's ending the PHP or something. Then again i could also be doing thing completely wrong - like i said, i'm new to HTML and PHP.
Thanks for any help.