Many Experts here in SO have strongly adviced against using mysql/i functions. Their advice is to embrace PDO instead. I'd fall in line with their advice, though.
In this light; i'd suggest the following:
<?php
//DATABASE CONNECTION CONFIGURATION:
defined("HOST") or define("HOST", "localhost"); //REPLACE WITH YOUR DB-HOST
defined("DBASE") or define("DBASE", "rgpv"); //REPLACE WITH YOUR DB NAME
defined("USER") or define("USER", "root"); //REPLACE WITH YOUR DB-USER
defined("PASS") or define("PASS", "root"); //REPLACE WITH YOUR DB-PASS
$post_enroll = isset($_POST['enroll']) ? htmlspecialchars(trim($_POST['enroll'])) : null; //PROTECT AGAINST ATTACKS
$post_mobile = isset($_POST['mobile']) ? htmlspecialchars(trim($_POST['mobile'])) : null; //PROTECT AGAINST ATTACKS
$post_email = isset($_POST['email']) ? htmlspecialchars(trim($_POST['email'])) : null; //PROTECT AGAINST ATTACKS
$post_password = isset($_POST['password']) ? htmlspecialchars(trim($_POST['password'])) : null; //PROTECT AGAINST ATTACKS
try {
$dbh = new PDO('mysql:host='.HOST.';dbname='. DBASE,USER,PASS);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $dbh->prepare("INSERT INTO login (`enroll`, `mobile`, `email`, `password`) VALUES (:enroll, :mobile, :email, :password)");
$stmt->bindParam(':enroll', $post_enroll);
$stmt->bindParam(':mobile', $post_mobile);
$stmt->bindParam(':email', $post_email);
$stmt->bindParam(':password', $post_password);
$status = $stmt->execute();
if(! $status ) {
die('Something went wrong...');
}
//GARBAGE COLLECTION
$dbh = null;
}catch(PDOException $e){
echo $e->getMessage();
}
?>
I hope this helps a bit...