This is not an easy task if the images you match against aren't identical to the one you have in your database.
Your best bet is to find an existing API or framework of some sort as the algorithms to spot similar pictures will get pretty complex. These are also probably going to cost you money.
Wikipedia has an article:
http://en.wikipedia.org/wiki/Reverse_image_search[
^]
Also
http://en.wikipedia.org/wiki/List_of_CBIR_engines[
^]
I've not used any of these, so you'll need to research yourself.