"->" in php breaks php tags


#1

Hi, I m creating script to connect DB:

<?php $serverName = "localhost"; $username = "root"; $password = "password"; // Create connection $conn = new mysqli($serverName, $username, $password); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully"; ?>

But when i check in browser, it shows out as text:
connect_error) {
die ("Connection failed: " . $conn->connect_error);
}
echo “Connected successfully”;
?>
I think something wrong with "->"
Please help me to figure it out, i m new to this.


#2

Hi, is there anyone here to help me this?


#3

Hmm, I figured it out, it relates to php VERSION.
Nothing relates to ATOM.
Thank you.