I have the following code which is part of a function to add a user to a database in PHP. It adds a user to a database.
if($user != '' && $pass != ''){
            $new_name_q = "INSERT IGNORE INTO $db_name (`User`, `Password` ,`Name`, `Medals`, `TextSize`)
                                         VALUES ('$user','$pass','$nameComplete', '000000', '18')";
            $new_name_rs = mysqli_query($connection1,$new_name_q);
            if(!$new_name_rs)
            {
                die("No name added: " . mysql_error());
            }
        }
The query works fine and I don't get any duplicates. But I would like to echo a warning to the user in case the query is ignored.
 
    