which part of this do i need to remove to stop it from checking for duplicate and simply inserting it?
i have tried and keep accidentally taking out an extra { or something
[php]// Validate username
if(empty(trim($_POST[“firstname”])))
{
$username_err = “Please enter a first name.”;
} else{
// Prepare a select statement
$sql = “SELECT firstname FROM managers WHERE firstname = ?”;
if($stmt = mysqli_prepare($link, $sql)){
// Bind variables to the prepared statement as parameters
mysqli_stmt_bind_param($stmt, “s”, $param_firstname);
// Set parameters
$param_firstname = trim($_POST[“firstname”]);
// Attempt to execute the prepared statement
if(mysqli_stmt_execute($stmt)){
/* store result */
mysqli_stmt_store_result($stmt);
if(mysqli_stmt_num_rows($stmt) == 1)
{
$username_err = “This first name is already taken.”;
} else{
$username = trim($_POST[“firstname”]);
}
} else{
echo “Oops! Something went wrong. Please try again later.”;
}
}
// Close statement
mysqli_stmt_close($stmt);
}[/php]