PHP code just prints on screen instead of running
<p>For some reason I can't connect to database. Here's my code:</p>

<pre><code>&lt;?php

//only process form if $_POST isnt empty
if ( ! empty( $_POST ) ) {

// Connect to MySQL
$mysqli = new mysqli( 'localhost', 'username', 'password',       'database' );

//Check connection
if ( $mysqli-&gt;connect_error ) {
die( 'Connect Error: ' . $mysqli-&gt;connect_errno . ': ' . $mysqli-  &gt;connect_error );
}   

//Insert form data
$sql = "INSERT INTO user ( Name, Username, Password, Email ) VALUES 
( '{mysqli-&gt;real_escape_string($_POST['Name'])}',
('{mysqli-&gt;real_escape_string($_POST['Lastname'])}',
('{mysqli-&gt;real_escape_string($_POST['Username'])}',
('{mysqli-&gt;real_escape_string($_POST['Password'])}' )
('{mysqli-&gt;real_escape_string($_POST['Email'])}' )";

//Print response from MySQL
if ( $insert ) {
echo "Success! Row ID: {$mysqli-&gt;insert_ID}";   



}else{  
die("Error: {$mysqli-&gt;errno} : {$mysqli-&gt;error}");
}

//Close our connection
$mysqli-&gt;close();
}

?&gt;
</code></pre>