Sunday, January 15, 2017

php - Parse error: syntax error, unexpected end of file in line 25

I am building a function and there is an error please help me to resolve this.



The error line is this:-





Parse error:syntax error, unexpected end of file in /home/u854338141/public_html/login/register.php on line 25




My Code:-



//Recieve username and password from android device or GET request
$user = $_GET['username'];
$pass = $_GET['password'];


//Database connection information
$dbhost = "mysql.hostinger.in";
$dbuser = "u854338141_root";
$dbpass = "1234567";
$dbname = "u854338141_demo";

//Create a connection to databse
$con = new mysqli($dbhost, $dbuser, $dbpass, $dbname);


//Define sql statement for you business logic: registration
$sql = "INSERT into login(username, password) VALUES('" . $user . "', '" .
$pass . "');

//Execute sql statement
$result = $con->query($sql);

if($result){
echo json_encode(array("Result"=>true));
}else{

echo json_encode(array("Result"=>false));
}

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...