if a new row is inserted you can use mysql_insert_id() function to retrieve the id of the inserted row. If no row was inserted it will return null.
Also i think mysql_error() holds a message if you try to enter unique data, however displaying that to the user can be a security risk should there ever happen any other errors.
echo "Row inserted";
echo "Row was not inserted, duplicate content";
So if you really want to check if a value exists already a simple query beforehand is probably the best way to go, but who knows i dont consider myself a sql pro