setAttribute(PDO::ATTR_EMULATE_PREPARES, TRUE); $dbh->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); // Escape the value of $author with quote() $sql = 'SELECT e_mail FROM registrn WHERE e_mail = '. $dbh->quote($e_mail) .'LIMIT 1'; //$sql="SELECT * FROM registrn WHERE e_mail='$eml'"; //$data = $_db->query("SELECT * FROM countries")->fetchAll(PDO::FETCH_ASSOC); // Execute the statement and echo the results $results = $dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC); //---------------- echo json_encode($results); //$dbh = null; } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "
"; die(); } ?>