Hi,
Been trying working with database but been stuck. I want to use php to check in a value already exist in db and prevent that value to enter twice, if the value does not exist, then we insert.
i have tried with php if statement; but could not get it right… Could help please how i should. here is my insert script:
try
{
$sql= ‘INSERT INTO user_registration SET
email= :email,
date = CURDATE()’;
$s = $pdo->prepare($sql);
$s->bindValue(’:email’, $_POST[‘email’]);
$test=$s->execute();
}
catch (PDOException $e)
{
echo “Problem with script”.$db_name.$e->getMessage();
}
Thanks