I\'m using MySQL 5.1 hosted at my ISP. This is my query
mysql_query(\" IF EXISTS(SELECT * FROM licensing_active WHERE title_1=\'$title_1\') THEN BEGIN
The syntax of your query is wrong. Checkout http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html
Use the on duplicate key syntax to achieve the result you want. See http://dev.mysql.com/doc/refman/5.0/en/insert-select.html
duplicate key syntax