You could perform a query that gets all rows from the DB with the give category, and if the row count is greater than 0 that means it already exists. For example (In MySQL):
<?php
if(mysql_num_rows(mysql_query("SELECT*FROM table WHERE category='$userGivenCategory'")) > 0)
{
echo "Already Exists";
}
else
{
echo "Does not exists";
}
?>
Hope this helps 😉