How can I check if a row already exists?
For example, I have the following table:
Table name: cities
cityName | country | continent
---------------------------------------------------
New York | U.S.A. | North America
Toronto | Canada | North America
London | U.K. | Europe
Sydney | Australia | Australia
Now, what I want to do, is to have some code to check if a city already exists, before submitting it (using a form) again.
For example, a user wants to submit the city Toronto, but as you can see, it already exists in the database. So basically, my question is, how can I make a script to check the table to see if Toronto is already there?