problem connecting database I followed a tutorial here:
construct.net/en/tutorials/simple-login-using-a-mysql-database-312
except that at home nothing happens.
the variable remains at 0.
and the objects do not fade.
<?php header('Access-Control-Allow-Origin: *');
$dbhost = "localhost";
$dbname = "stockage";
$dbuser = "root";
$dbpass = "";
try{
$dbcon = new PDO("mysql:host={$dbhost};dbname={$dbname}",$dbuser,$dbpass);
$dbcon->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = "SELECT id FROM members WHERE username = :username AND password = :password";
$statement = $dbcon->prepare($query);
$statement->execute(
array(
"username" => $_GET["fname"],
"password" => $_GET["fpass"]
)
);
$count = $statement->rowCount();
if($count > 0)
{
echo "connetion etablie";
}
}
catch(PDOException $ex){
die($ex->getMessage());
}
?>