Hello,
I have created a php file that will log into my database and the insert some values to the tables. But every time that i run the file from the url it says: Parse error: syntax error, unexpected ‘$server_password’ (T_VARIABLE) in /storage/h14/747/1435747/public_html/InsertUser.php on line 4. I also want to mention that when go to Manage Database on the site in the DB Host table it says “localhost” and on the top of the page there is a link “unitydatabase.000webhostapp.com” is my database running on localhost or it runs normally on the internet using the url “unitydatabase.000webhostapp.com” Sorry for bad english.
This is the php file that i have.
<?php $servername = "unitydatabase.000webhostapp.com"; $server_username = "id1435747_unitydatabase" $server_password = "My_Database_password_here"; $dbName = "id1435747_unitydatabase"; $username = $_POST["usernamePost"]; $email = $_POST["emailPost"]; $password = $_POST["passwordPost"]; //Make Connection $conn = new mysqli ($servername, $server_username, $server_password, $dbName); //Check Connection if(!$conn) { die("Connection Failed. ". mysqli_connect_error()); } $sql = "INSERT INTO users (username, email, password) VALUES ('".$username."','".$email."','".$password."')"; $result = mysqli_query($conn ,$sql); if(!result) echo "there was an error"; else echo "Everything ok."; ?>Thanks you in advance.