If i already have record with the exact same data in mysql database i dont want the php code to enter it again.
The code i am using is
mysql_query(" ALTER TABLE tablename ADD UNIQUE INDEX(pageid, name) INSERT IGNORE INTO `tablename`
VALUES ('2','3','4'));
It doesnt seem to work. What is the problem.
Execute this query from MySQL and create the index first.
Then you can perform the insert query from PHP